1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-27 13:56:24 +00:00

🐛 Prevent Linear Advance stall (#25696)

This commit is contained in:
tombrazier 2023-04-17 23:48:56 +01:00 committed by GitHub
parent ff44663f5f
commit 4d8ab1c401
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1578,7 +1578,7 @@ void Stepper::isr() {
advance_isr();
nextAdvanceISR = la_interval;
}
else if (nextAdvanceISR == LA_ADV_NEVER) // Start LA steps if necessary
else if (nextAdvanceISR > la_interval) // Start/accelerate LA steps if necessary
nextAdvanceISR = la_interval;
#endif
@ -2169,7 +2169,8 @@ hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate) {
#ifdef CPU_32_BIT
// A fast processor can just do integer division
return step_rate ? uint32_t(STEPPER_TIMER_RATE) / step_rate : HAL_TIMER_TYPE_MAX;
constexpr uint32_t min_step_rate = uint32_t(STEPPER_TIMER_RATE) / HAL_TIMER_TYPE_MAX;
return step_rate > min_step_rate ? uint32_t(STEPPER_TIMER_RATE) / step_rate : HAL_TIMER_TYPE_MAX;
#else