From bf38ef23e50677a5fe949e74131e9377bc3f743a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 21 Apr 2022 08:58:45 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=20Prevent=20BABYSTEP=20freeze?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See #22830, #13300 --- Marlin/src/module/stepper.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 6c18169067..1140a6eb1e 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -3072,7 +3072,12 @@ void Stepper::report_positions() { #else #define CYCLES_EATEN_BABYSTEP 0 #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 #define _SAVE_START() const hal_timer_t pulse_start = HAL_timer_get_count(MF_TIMER_PULSE)