diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 5ba817ea3e..24a1638731 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -314,7 +314,7 @@ void unified_bed_leveling::G29() { const bool may_move = p_val == 1 || p_val == 2 || p_val == 4 || parser.seen_test('J'); // Potentially disable Fixed-Time Motion for probing - TERN_(FT_MOTION, FTMotionDisableInScope FT_Disabler); + TERN_(FT_MOTION, FTM_DISABLE_IN_SCOPE()); // Check for commands that require the printer to be homed if (may_move) { diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index 7b826acba7..0e48ec1449 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -68,7 +68,7 @@ inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_ECHOLNPGM(" void GcodeSuite::G29() { // Potentially disable Fixed-Time Motion for probing - TERN_(FT_MOTION, FTMotionDisableInScope FT_Disabler); + TERN_(FT_MOTION, FTM_DISABLE_IN_SCOPE()); DEBUG_SECTION(log_G29, "G29", true); diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 92f05b1fba..20b50cd7f1 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -131,7 +131,7 @@ inline void home_z_safely() { // Potentially disable Fixed-Time Motion for homing - TERN_(FT_MOTION, FTMotionDisableInScope FT_Disabler); + TERN_(FT_MOTION, FTM_DISABLE_IN_SCOPE()); DEBUG_SECTION(log_G28, "home_z_safely", DEBUGGING(LEVELING)); @@ -290,7 +290,7 @@ void GcodeSuite::G28() { #endif // Potentially disable Fixed-Time Motion for homing - TERN_(FT_MOTION, FTMotionDisableInScope FT_Disabler); + TERN_(FT_MOTION, FTM_DISABLE_IN_SCOPE()); // Always home with tool 0 active #if HAS_MULTI_HOTEND diff --git a/Marlin/src/gcode/probe/G30.cpp b/Marlin/src/gcode/probe/G30.cpp index c4f45e785f..463a4cd836 100644 --- a/Marlin/src/gcode/probe/G30.cpp +++ b/Marlin/src/gcode/probe/G30.cpp @@ -81,7 +81,7 @@ void GcodeSuite::G30() { TERN_(HAS_PTC, ptc.set_enabled(parser.boolval('C', true))); // Potentially disable Fixed-Time Motion for probing - TERN_(FT_MOTION, FTMotionDisableInScope FT_Disabler); + TERN_(FT_MOTION, FTM_DISABLE_IN_SCOPE()); // Probe the bed, optionally raise, and return the measured height const float measured_z = probe.probe_at_point(probepos, raise_after); diff --git a/Marlin/src/module/ft_motion.h b/Marlin/src/module/ft_motion.h index 420b0fb2aa..bec65f2abf 100644 --- a/Marlin/src/module/ft_motion.h +++ b/Marlin/src/module/ft_motion.h @@ -258,8 +258,8 @@ extern FTMotion ftMotion; // Use ftMotion.thing, not FTMotion::thing. * Optional behavior to turn FT Motion off for homing/probing. * Applies when FTM_HOME_AND_PROBE is disabled. */ -typedef struct FTMotionDisableInScope { - #if DISABLED(FTM_HOME_AND_PROBE) +#if DISABLED(FTM_HOME_AND_PROBE) + typedef struct FTMotionDisableInScope { bool isactive; FTMotionDisableInScope() { isactive = ftMotion.cfg.active; @@ -269,5 +269,7 @@ typedef struct FTMotionDisableInScope { ftMotion.cfg.active = isactive; if (isactive) ftMotion.init(); } - #endif -} FTMotionDisableInScope_t; + } FTMotionDisableInScope_t; +#endif + +#define FTM_DISABLE_IN_SCOPE() TERN(FTM_HOME_AND_PROBE, NOOP, FTMotionDisableInScope FT_Disabler) diff --git a/Marlin/src/module/ft_motion/stepping.cpp b/Marlin/src/module/ft_motion/stepping.cpp index f44087a7d4..fec5d05555 100644 --- a/Marlin/src/module/ft_motion/stepping.cpp +++ b/Marlin/src/module/ft_motion/stepping.cpp @@ -29,7 +29,7 @@ void Stepping::reset() { stepper_plan.reset(); - delta_error_q32.set(LOGICAL_AXIS_LIST_1(1 << 31)); // Start as 0.5 in q32 so steps are rounded + delta_error_q32.set(LOGICAL_AXIS_LIST_1(1UL << 31)); // Start as 0.5 in q32 so steps are rounded step_bits = 0; bresenham_iterations_pending = 0; }