🐛 Prevent BABYSTEP freeze

See #22830, #13300
This commit is contained in:
Scott Lahteine 2022-04-21 08:58:45 -05:00 committed by Scott Lahteine
parent f6f31434b8
commit 99252cf0cd

View File

@ -2979,7 +2979,12 @@ void Stepper::report_positions() {
#else #else
#define CYCLES_EATEN_BABYSTEP 0 #define CYCLES_EATEN_BABYSTEP 0
#endif #endif
#define EXTRA_CYCLES_BABYSTEP (STEP_PULSE_CYCLES - (CYCLES_EATEN_BABYSTEP))
#if CYCLES_EATEN_BABYSTEP < STEP_PULSE_CYCLES
#define EXTRA_CYCLES_BABYSTEP (STEP_PULSE_CYCLES - (CYCLES_EATEN_BABYSTEP))
#else
#define EXTRA_CYCLES_BABYSTEP 0
#endif
#if EXTRA_CYCLES_BABYSTEP > 20 #if EXTRA_CYCLES_BABYSTEP > 20
#define _SAVE_START() const hal_timer_t pulse_start = HAL_timer_get_count(MF_TIMER_PULSE) #define _SAVE_START() const hal_timer_t pulse_start = HAL_timer_get_count(MF_TIMER_PULSE)