From 0ee1c1e4e15f818aba25f473e388484276882144 Mon Sep 17 00:00:00 2001 From: David Buezas Date: Mon, 29 Sep 2025 01:14:14 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=F0=9F=9A=B8=20Fix=20stale=20LA=20b?= =?UTF-8?q?lock=20flag,=20FT=20Motion=20reporting=20(#28078)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/feature/ft_motion/M493.cpp | 42 +++++++++++---------- Marlin/src/module/planner.cpp | 7 ++-- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/Marlin/src/gcode/feature/ft_motion/M493.cpp b/Marlin/src/gcode/feature/ft_motion/M493.cpp index 158ca27706..4ff5e50924 100644 --- a/Marlin/src/gcode/feature/ft_motion/M493.cpp +++ b/Marlin/src/gcode/feature/ft_motion/M493.cpp @@ -50,28 +50,32 @@ void say_shaping() { SERIAL_ECHO_TERNARY(ftMotion.cfg.active, "Fixed-Time Motion ", "en", "dis", "abled"); // FT Shaping + const bool is_shaping = AXIS_IS_SHAPING(X) || AXIS_IS_SHAPING(Y) || AXIS_IS_SHAPING(Z) || AXIS_IS_SHAPING(E); bool sep = false; - SERIAL_ECHOPGM(" ("); - #if HAS_X_AXIS - if (AXIS_IS_SHAPING(X)) say_shaper_type(X_AXIS, sep, STEPPER_A_NAME); - #endif - #if HAS_Y_AXIS - if (AXIS_IS_SHAPING(Y)) say_shaper_type(Y_AXIS, sep, STEPPER_B_NAME); - #endif - #if ENABLED(FTM_SHAPER_Z) - if (AXIS_IS_SHAPING(Z)) say_shaper_type(Z_AXIS, sep, STEPPER_C_NAME); - #endif - #if ENABLED(FTM_SHAPER_E) - if (AXIS_IS_SHAPING(E)) say_shaper_type(E_AXIS, sep, 'E'); - #endif - SERIAL_ECHOLNPGM(")"); + if (is_shaping) { + SERIAL_ECHOPGM(" ("); + #if HAS_X_AXIS + if (AXIS_IS_SHAPING(X)) say_shaper_type(X_AXIS, sep, STEPPER_A_NAME); + #endif + #if HAS_Y_AXIS + if (AXIS_IS_SHAPING(Y)) say_shaper_type(Y_AXIS, sep, STEPPER_B_NAME); + #endif + #if ENABLED(FTM_SHAPER_Z) + if (AXIS_IS_SHAPING(Z)) say_shaper_type(Z_AXIS, sep, STEPPER_C_NAME); + #endif + #if ENABLED(FTM_SHAPER_E) + if (AXIS_IS_SHAPING(E)) say_shaper_type(E_AXIS, sep, 'E'); + #endif + SERIAL_CHAR(')'); + } + SERIAL_EOL(); const bool z_based = TERN0(HAS_DYNAMIC_FREQ_MM, ftMotion.cfg.dynFreqMode == dynFreqMode_Z_BASED), g_based = TERN0(HAS_DYNAMIC_FREQ_G, ftMotion.cfg.dynFreqMode == dynFreqMode_MASS_BASED), dynamic = z_based || g_based; // FT Dynamic Frequency Mode - if (AXIS_IS_SHAPING(X) || AXIS_IS_SHAPING(Y) || AXIS_IS_SHAPING(Z) || AXIS_IS_SHAPING(E)) { + if (is_shaping) { #if HAS_DYNAMIC_FREQ SERIAL_ECHOPGM("Dynamic Frequency Mode "); switch (ftMotion.cfg.dynFreqMode) { @@ -119,11 +123,10 @@ void say_shaping() { } #if HAS_EXTRUDERS - SERIAL_ECHO_TERNARY(ftMotion.cfg.linearAdvEna, "Linear Advance ", "en", "dis", "abled"); - if (ftMotion.cfg.linearAdvEna) + if (ftMotion.cfg.active) { + SERIAL_ECHO_TERNARY(ftMotion.cfg.linearAdvEna, "Linear Advance ", "en", "dis", "abled"); SERIAL_ECHOLNPGM(". Gain: ", ftMotion.cfg.linearAdvK); - else - SERIAL_EOL(); + } #endif } @@ -287,7 +290,6 @@ void GcodeSuite::M493() { const bool val = parser.value_bool(); ftMotion.cfg.linearAdvEna = val; flag.report = true; - SERIAL_ECHO_TERNARY(val, "Linear Advance ", "en", "dis", "abled.\n"); } // Pressure control (linear advance) gain parameter. diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 47e4ed4f28..673bb13a39 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -2442,9 +2442,6 @@ bool Planner::_populate_block( } } } - #if ANY(SMOOTH_LIN_ADVANCE, FTM_HAS_LIN_ADVANCE) - block->use_advance_lead = use_adv_lead; - #endif } #endif // LIN_ADVANCE || FTM_HAS_LIN_ADVANCE @@ -2498,6 +2495,10 @@ bool Planner::_populate_block( #endif #endif + #if ANY(SMOOTH_LIN_ADVANCE, FTM_HAS_LIN_ADVANCE) + block->use_advance_lead = use_adv_lead; + #endif + // Formula for the average speed over a 1 step worth of distance if starting from zero and // accelerating at the current limit. Since we can only change the speed every step this is a // good lower limit for the entry and exit speeds. Note that for calculate_trapezoid_for_block()