Skip to content

Commit ade05c0

Browse files
committed
🚸 Revert FT Motion tune menu
1 parent 5140726 commit ade05c0

File tree

5 files changed

+36
-66
lines changed

5 files changed

+36
-66
lines changed

Marlin/src/HAL/HC32/pinsDebug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
#define M43_NEVER_TOUCH(Q) (IS_HOST_USART_PIN(Q) || IS_OSC_PIN(Q))
7272
#endif
7373

74-
static pin_t digitalPinToAnalogIndex(pin_t pin) {
74+
static int8_t digitalPinToAnalogIndex(pin_t pin) {
7575
if (!isValidPin(pin)) return -1;
7676
const int8_t adc_channel = int8_t(PIN_MAP[pin].adc_info.channel);
7777
return pin_t(adc_channel);

Marlin/src/HAL/STM32/pinsDebug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ int8_t digital_pin_to_analog_pin(const pin_t Ard_num) {
173173
if (WITHIN(Ard_num, NUM_ANALOG_FIRST, NUM_ANALOG_LAST))
174174
return Ard_num - NUM_ANALOG_FIRST;
175175

176-
const uint32_t ind = digitalPinToAnalogIndex(Ard_num);
176+
const int8_t ind = digitalPinToAnalogIndex(Ard_num);
177177
return (ind < NUM_ANALOG_INPUTS) ? ind : -1;
178178
}
179179

Marlin/src/HAL/STM32F1/pinsDebug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS];
5454

5555
int8_t get_pin_mode(const pin_t pin) { return isValidPin(pin) ? _GET_MODE(pin) : -1; }
5656

57-
pin_t digitalPinToAnalogIndex(const pin_t pin) {
57+
int8_t digitalPinToAnalogIndex(const pin_t pin) {
5858
if (!isValidPin(pin)) return -1;
5959
pin_t adc_channel = pin_t(PIN_MAP[pin].adc_channel);
6060
#ifdef NUM_ANALOG_INPUTS

Marlin/src/lcd/menu/menu_motion.cpp

Lines changed: 33 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -331,36 +331,6 @@ void menu_move() {
331331
ui.go_back();
332332
}
333333

334-
TString ftmode(5), dmode(10);
335-
336-
void ftm_menu_get_msg_strings() {
337-
ft_config_t &c = ftMotion.cfg;
338-
339-
switch (c.mode) {
340-
default:
341-
case ftMotionMode_DISABLED: ftmode = GET_TEXT_F(MSG_LCD_OFF); break;
342-
case ftMotionMode_ENABLED: ftmode = GET_TEXT_F(MSG_LCD_ON); break;
343-
case ftMotionMode_ZV: ftmode = GET_TEXT_F(MSG_FTM_ZV); break;
344-
case ftMotionMode_ZVD: ftmode = GET_TEXT_F(MSG_FTM_ZVD); break;
345-
case ftMotionMode_ZVDD: ftmode = GET_TEXT_F(MSG_FTM_ZVDD); break;
346-
case ftMotionMode_ZVDDD: ftmode = GET_TEXT_F(MSG_FTM_ZVDDD);break;
347-
case ftMotionMode_EI: ftmode = GET_TEXT_F(MSG_FTM_EI); break;
348-
case ftMotionMode_2HEI: ftmode = GET_TEXT_F(MSG_FTM_2HEI); break;
349-
case ftMotionMode_3HEI: ftmode = GET_TEXT_F(MSG_FTM_3HEI); break;
350-
case ftMotionMode_MZV: ftmode = GET_TEXT_F(MSG_FTM_MZV); break;
351-
}
352-
353-
#if HAS_DYNAMIC_FREQ
354-
switch (c.dynFreqMode) {
355-
default:
356-
case dynFreqMode_DISABLED: dmode = GET_TEXT_F(MSG_LCD_OFF); break;
357-
case dynFreqMode_Z_BASED: dmode = GET_TEXT_F(MSG_FTM_Z_BASED); break;
358-
case dynFreqMode_MASS_BASED: dmode = GET_TEXT_F(MSG_FTM_MASS_BASED); break;
359-
}
360-
#endif
361-
362-
}
363-
364334
inline void menu_ftm_cmpn_x() {
365335
const ftMotionShaper_t shaper = ftMotion.cfg.shaper[X_AXIS];
366336
START_MENU();
@@ -421,7 +391,33 @@ void menu_move() {
421391
void menu_ft_motion() {
422392
ft_config_t &c = ftMotion.cfg;
423393

424-
ftm_menu_get_msg_strings();
394+
FSTR_P ftshaper[1 + ENABLED(HAS_Y_AXIS)] {};
395+
396+
#if HAS_X_AXIS
397+
for (uint_fast8_t a = X_AXIS; a <= TERN(HAS_Y_AXIS, Y_AXIS, X_AXIS); ++a) {
398+
switch (c.shaper[a]) {
399+
case ftMotionShaper_NONE: ftshaper[a] = GET_TEXT_F(MSG_LCD_OFF); break;
400+
case ftMotionShaper_ZV: ftshaper[a] = GET_TEXT_F(MSG_FTM_ZV); break;
401+
case ftMotionShaper_ZVD: ftshaper[a] = GET_TEXT_F(MSG_FTM_ZVD); break;
402+
case ftMotionShaper_ZVDD: ftshaper[a] = GET_TEXT_F(MSG_FTM_ZVDD); break;
403+
case ftMotionShaper_ZVDDD: ftshaper[a] = GET_TEXT_F(MSG_FTM_ZVDDD);break;
404+
case ftMotionShaper_EI: ftshaper[a] = GET_TEXT_F(MSG_FTM_EI); break;
405+
case ftMotionShaper_2HEI: ftshaper[a] = GET_TEXT_F(MSG_FTM_2HEI); break;
406+
case ftMotionShaper_3HEI: ftshaper[a] = GET_TEXT_F(MSG_FTM_3HEI); break;
407+
case ftMotionShaper_MZV: ftshaper[a] = GET_TEXT_F(MSG_FTM_MZV); break;
408+
}
409+
}
410+
#endif
411+
412+
#if HAS_DYNAMIC_FREQ
413+
FSTR_P dmode;
414+
switch (c.dynFreqMode) {
415+
default:
416+
case dynFreqMode_DISABLED: dmode = GET_TEXT_F(MSG_LCD_OFF); break;
417+
case dynFreqMode_Z_BASED: dmode = GET_TEXT_F(MSG_FTM_Z_BASED); break;
418+
case dynFreqMode_MASS_BASED: dmode = GET_TEXT_F(MSG_FTM_MASS_BASED); break;
419+
}
420+
#endif
425421

426422
START_MENU();
427423
BACK_ITEM(MSG_MOTION);
@@ -458,7 +454,7 @@ void menu_move() {
458454

459455
#if HAS_DYNAMIC_FREQ
460456
SUBMENU(MSG_FTM_DYN_MODE, menu_ftm_dyn_mode);
461-
MENU_ITEM_ADDON_START_RJ(dmode.length()); lcd_put_u8str(dmode); MENU_ITEM_ADDON_END();
457+
MENU_ITEM_ADDON_START_RJ(11); lcd_put_u8str(dmode); MENU_ITEM_ADDON_END();
462458
if (c.dynFreqMode != dynFreqMode_DISABLED) {
463459
#if HAS_X_AXIS
464460
EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_FTM_DFREQ_K_N, &c.dynFreqK[X_AXIS], 0.0f, 20.0f);
@@ -477,32 +473,14 @@ void menu_move() {
477473
END_MENU();
478474
}
479475

480-
void menu_tune_ft_motion() {
481-
482-
ftm_menu_get_msg_strings();
483-
484-
ft_config_t &c = ftMotion.cfg;
485-
486-
START_MENU();
487-
SUBMENU(MSG_FTM_MODE, menu_ftm_mode);
488-
MENU_ITEM_ADDON_START_RJ(ftmode.length()); lcd_put_u8str(ftmode); MENU_ITEM_ADDON_END();
489-
#if HAS_DYNAMIC_FREQ
490-
SUBMENU(MSG_FTM_DYN_MODE, menu_ftm_dyn_mode);
491-
MENU_ITEM_ADDON_START_RJ(dmode.length()); lcd_put_u8str(dmode); MENU_ITEM_ADDON_END();
492-
#endif
493-
#if HAS_EXTRUDERS
494-
EDIT_ITEM(bool, MSG_LINEAR_ADVANCE, &c.linearAdvEna);
495-
if (c.linearAdvEna) EDIT_ITEM(float62, MSG_ADVANCE_K, &c.linearAdvK, 0.0f, 1000.0f);
496-
#endif
497-
498-
END_MENU();
499-
500-
}
501-
502476
#endif // FT_MOTION_MENU
503477

504478
void menu_motion() {
505479

480+
#if ENABLED(FT_MOTION_MENU)
481+
const bool is_busy = printer_busy();
482+
#endif
483+
506484
START_MENU();
507485

508486
//
@@ -532,7 +510,7 @@ void menu_motion() {
532510
// M493 - Fixed-Time Motion
533511
//
534512
#if ENABLED(FT_MOTION_MENU)
535-
SUBMENU(MSG_FIXED_TIME_MOTION, menu_ft_motion);
513+
if (!is_busy) SUBMENU(MSG_FIXED_TIME_MOTION, menu_ft_motion);
536514
#endif
537515

538516
//

Marlin/src/lcd/menu/menu_tune.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,6 @@ void menu_tune() {
231231
#endif
232232
#endif
233233

234-
//
235-
// FT_MOTION
236-
//
237-
#if ENABLED(FT_MOTION_MENU)
238-
extern void menu_tune_ft_motion();
239-
SUBMENU(MSG_FIXED_TIME_MOTION, menu_tune_ft_motion);
240-
#endif
241-
242234
END_MENU();
243235
}
244236

0 commit comments

Comments
 (0)