You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main optimization eliminates the double MODER register write when on=true.
Previously: MODER &= ~(0xFFFFFF) then MODER |= pin_bits (two writes)
Now: MODER = 0 when off, or MODER = pin_bits when on (single write each)
Otherwise, the compiler is already doing a pretty good job.
Additional improvements:
- Remove unused idxToPin() function (was just returning idx)
- Remove unused reverse() function
- Use direct pin array access and bit shifts for efficiency
Signed-off-by: iabdalkader <[email protected]>
0 commit comments