prusa3d / Prusa-Firmware-MMU

Other
32 stars 15 forks source link

optimisation: Add `<<` operator to `ErrorCode` #286

Closed gudnimg closed 1 year ago

gudnimg commented 1 year ago

This helps reduce code size a little bit

Change in memory: Flash: -54 bytes SRAM: 0 bytes

gudnimg commented 1 year ago

ErrorCode needs documentation updated (that we are relying on the order of TMC_*_BITs) + some ordering static assert must be included to ensure, that the build chokes if someone plays with the bits accidentally.

Otherwise, good job 👍

Would adding a unit test for AddErrorAxisBit() suffice? I see it's not tested currently.