Guard time_spent_in/out_isr
with MULTISTEPPING_LIMIT > 1
#27147
+25
−38
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Guard
time_spent_in_isr
andtime_spent_out_isr
withMULTISTEPPING_LIMIT > 1
since the values are not actually used/useful in this case. The compiler doesn't do it for us especially since it won't optimize away even reads on anyvolatile
variables.Benefits
Small speedup in max theoretically achievable stepping speed since there's less computation in the ISR. Example from LPC1769 with 80steps/mm: ~5400mm/s to ~6100mm/s (though note it was pre-optimized locally with
-flto
build option - for better inlining - and a spattering of[[gnu::section(".ramcode")]]
to make sure the stepper ISR code was contained in microcontroller RAM).Before, looking at the step/dir pins with a logic analyzer (at 16Mhz capture rate):
After: