File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1578,7 +1578,7 @@ void Stepper::isr() {
1578
1578
advance_isr ();
1579
1579
nextAdvanceISR = la_interval;
1580
1580
}
1581
- else if (nextAdvanceISR == LA_ADV_NEVER ) // Start LA steps if necessary
1581
+ else if (nextAdvanceISR > la_interval ) // Start/accelerate LA steps if necessary
1582
1582
nextAdvanceISR = la_interval;
1583
1583
#endif
1584
1584
@@ -2169,7 +2169,8 @@ hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate) {
2169
2169
#ifdef CPU_32_BIT
2170
2170
2171
2171
// A fast processor can just do integer division
2172
- return step_rate ? uint32_t (STEPPER_TIMER_RATE) / step_rate : HAL_TIMER_TYPE_MAX;
2172
+ constexpr uint32_t min_step_rate = uint32_t (STEPPER_TIMER_RATE) / HAL_TIMER_TYPE_MAX;
2173
+ return step_rate > min_step_rate ? uint32_t (STEPPER_TIMER_RATE) / step_rate : HAL_TIMER_TYPE_MAX;
2173
2174
2174
2175
#else
2175
2176
You can’t perform that action at this time.
0 commit comments