Skip to content

Commit a5a6732

Browse files
🐛 Fix FT Motion M496 processing, etc. (#28261)
Co-authored-by: Scott Lahteine <[email protected]>
1 parent 1e45765 commit a5a6732

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

Marlin/src/feature/e_parser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void EmergencyParser::update(EmergencyParser::State &state, const uint8_t c) {
150150
case EP_M4:
151151
switch (c) {
152152
case '1' :state = EP_M41; break;
153-
#if ENABLED(FT_MOTION_RESONANCE_TEST)
153+
#if ENABLED(FTM_RESONANCE_TEST)
154154
case '9': state = EP_M49; break;
155155
#endif
156156
default: state = EP_IGNORE;

Marlin/src/gcode/feature/ft_motion/M495_M496.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#if ENABLED(FTM_RESONANCE_TEST)
2626

2727
#include "../../gcode.h"
28+
#include "../../../lcd/marlinui.h"
2829
#include "../../../module/ft_motion.h"
2930
#include "../../../module/ft_motion/resonance_generator.h"
3031

@@ -173,6 +174,7 @@ void GcodeSuite::M496() {
173174
if (ftMotion.rtg.isActive()) {
174175
ftMotion.rtg.abort();
175176
EmergencyParser::rt_stop_by_M496 = false;
177+
ui.refresh();
176178
#if DISABLED(MARLIN_SMALL_BUILD)
177179
SERIAL_ECHOLN(F("Resonance Test"), F(" aborted."));
178180
#endif

Marlin/src/lcd/menu/menu_motion.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,12 +424,18 @@ void menu_move() {
424424

425425
if (ftMotion.rtg.isActive() && !ftMotion.rtg.isDone()) {
426426
STATIC_ITEM(MSG_FTM_RT_RUNNING);
427-
ACTION_ITEM(MSG_FTM_RT_STOP, []{ ftMotion.rtg.abort(); ui.refresh(); });
427+
GCODES_ITEM(MSG_FTM_RT_STOP, F("M496"));
428428
}
429429
else {
430-
GCODES_ITEM_N(X_AXIS, MSG_FTM_RT_START_N, F("M495 X S"));
431-
GCODES_ITEM_N(Y_AXIS, MSG_FTM_RT_START_N, F("M495 Y S"));
432-
GCODES_ITEM_N(Z_AXIS, MSG_FTM_RT_START_N, F("M495 Z S"));
430+
#if HAS_X_AXIS
431+
GCODES_ITEM_N(X_AXIS, MSG_FTM_RT_START_N, F("M495 X S"));
432+
#endif
433+
#if HAS_Y_AXIS
434+
GCODES_ITEM_N(Y_AXIS, MSG_FTM_RT_START_N, F("M495 Y S"));
435+
#endif
436+
#if HAS_Z_AXIS
437+
GCODES_ITEM_N(Z_AXIS, MSG_FTM_RT_START_N, F("M495 Z S"));
438+
#endif
433439
SUBMENU(MSG_FTM_RETRIEVE_FREQ, menu_ftm_resonance_freq);
434440
}
435441

0 commit comments

Comments
 (0)