Skip to content

[2.0.x] Convert custom maths to inlines#10728

Merged
thinkyhead merged 1 commit intoMarlinFirmware:bugfix-2.0.xfrom
thinkyhead:bf2_inline_maths
May 13, 2018
Merged

[2.0.x] Convert custom maths to inlines#10728
thinkyhead merged 1 commit intoMarlinFirmware:bugfix-2.0.xfrom
thinkyhead:bf2_inline_maths

Conversation

@thinkyhead
Copy link
Member

Split from #10688 to make that PR more concise. Merge this ahead of that PR, then rebase it.


Convert custom maths macros into force-inline functions so they can do type-checking.

@ejtagle
Copy link
Contributor

ejtagle commented May 13, 2018

@thinkyhead

#if sizeof(step_rate) == 4

will not work, as sizeof() is not available to the preprocessor, and the size of step_rate is now always 32bits. In fact, either `#ifdef __AVR__´ or just rename the 32bit macro to the same name as the AVR macro...

@thinkyhead
Copy link
Member Author

thinkyhead commented May 13, 2018

will not work

Ah, right. I've used it with static_assert, but that's another layer.

@thinkyhead thinkyhead merged commit 883b0c9 into MarlinFirmware:bugfix-2.0.x May 13, 2018
@thinkyhead thinkyhead deleted the bf2_inline_maths branch May 13, 2018 13:10
thinkyhead added a commit that referenced this pull request May 13, 2018
For parity with #10728

Co-Authored-By: ejtagle <ejtagle@hotmail.com>
thinkyhead added a commit that referenced this pull request Sep 22, 2018
For parity with #10728

Co-Authored-By: ejtagle <ejtagle@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants