1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-26 21:36:21 +00:00

🚸 Revert FT Motion tune menu

This commit is contained in:
Scott Lahteine 2024-07-15 15:23:47 -05:00
parent 5140726c70
commit ade05c045e
5 changed files with 36 additions and 66 deletions

View File

@ -71,7 +71,7 @@
#define M43_NEVER_TOUCH(Q) (IS_HOST_USART_PIN(Q) || IS_OSC_PIN(Q)) #define M43_NEVER_TOUCH(Q) (IS_HOST_USART_PIN(Q) || IS_OSC_PIN(Q))
#endif #endif
static pin_t digitalPinToAnalogIndex(pin_t pin) { static int8_t digitalPinToAnalogIndex(pin_t pin) {
if (!isValidPin(pin)) return -1; if (!isValidPin(pin)) return -1;
const int8_t adc_channel = int8_t(PIN_MAP[pin].adc_info.channel); const int8_t adc_channel = int8_t(PIN_MAP[pin].adc_info.channel);
return pin_t(adc_channel); return pin_t(adc_channel);

View File

@ -173,7 +173,7 @@ int8_t digital_pin_to_analog_pin(const pin_t Ard_num) {
if (WITHIN(Ard_num, NUM_ANALOG_FIRST, NUM_ANALOG_LAST)) if (WITHIN(Ard_num, NUM_ANALOG_FIRST, NUM_ANALOG_LAST))
return Ard_num - NUM_ANALOG_FIRST; return Ard_num - NUM_ANALOG_FIRST;
const uint32_t ind = digitalPinToAnalogIndex(Ard_num); const int8_t ind = digitalPinToAnalogIndex(Ard_num);
return (ind < NUM_ANALOG_INPUTS) ? ind : -1; return (ind < NUM_ANALOG_INPUTS) ? ind : -1;
} }

View File

@ -54,7 +54,7 @@ extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS];
int8_t get_pin_mode(const pin_t pin) { return isValidPin(pin) ? _GET_MODE(pin) : -1; } int8_t get_pin_mode(const pin_t pin) { return isValidPin(pin) ? _GET_MODE(pin) : -1; }
pin_t digitalPinToAnalogIndex(const pin_t pin) { int8_t digitalPinToAnalogIndex(const pin_t pin) {
if (!isValidPin(pin)) return -1; if (!isValidPin(pin)) return -1;
pin_t adc_channel = pin_t(PIN_MAP[pin].adc_channel); pin_t adc_channel = pin_t(PIN_MAP[pin].adc_channel);
#ifdef NUM_ANALOG_INPUTS #ifdef NUM_ANALOG_INPUTS

View File

@ -331,36 +331,6 @@ void menu_move() {
ui.go_back(); ui.go_back();
} }
TString ftmode(5), dmode(10);
void ftm_menu_get_msg_strings() {
ft_config_t &c = ftMotion.cfg;
switch (c.mode) {
default:
case ftMotionMode_DISABLED: ftmode = GET_TEXT_F(MSG_LCD_OFF); break;
case ftMotionMode_ENABLED: ftmode = GET_TEXT_F(MSG_LCD_ON); break;
case ftMotionMode_ZV: ftmode = GET_TEXT_F(MSG_FTM_ZV); break;
case ftMotionMode_ZVD: ftmode = GET_TEXT_F(MSG_FTM_ZVD); break;
case ftMotionMode_ZVDD: ftmode = GET_TEXT_F(MSG_FTM_ZVDD); break;
case ftMotionMode_ZVDDD: ftmode = GET_TEXT_F(MSG_FTM_ZVDDD);break;
case ftMotionMode_EI: ftmode = GET_TEXT_F(MSG_FTM_EI); break;
case ftMotionMode_2HEI: ftmode = GET_TEXT_F(MSG_FTM_2HEI); break;
case ftMotionMode_3HEI: ftmode = GET_TEXT_F(MSG_FTM_3HEI); break;
case ftMotionMode_MZV: ftmode = GET_TEXT_F(MSG_FTM_MZV); break;
}
#if HAS_DYNAMIC_FREQ
switch (c.dynFreqMode) {
default:
case dynFreqMode_DISABLED: dmode = GET_TEXT_F(MSG_LCD_OFF); break;
case dynFreqMode_Z_BASED: dmode = GET_TEXT_F(MSG_FTM_Z_BASED); break;
case dynFreqMode_MASS_BASED: dmode = GET_TEXT_F(MSG_FTM_MASS_BASED); break;
}
#endif
}
inline void menu_ftm_cmpn_x() { inline void menu_ftm_cmpn_x() {
const ftMotionShaper_t shaper = ftMotion.cfg.shaper[X_AXIS]; const ftMotionShaper_t shaper = ftMotion.cfg.shaper[X_AXIS];
START_MENU(); START_MENU();
@ -421,7 +391,33 @@ void menu_move() {
void menu_ft_motion() { void menu_ft_motion() {
ft_config_t &c = ftMotion.cfg; ft_config_t &c = ftMotion.cfg;
ftm_menu_get_msg_strings(); FSTR_P ftshaper[1 + ENABLED(HAS_Y_AXIS)] {};
#if HAS_X_AXIS
for (uint_fast8_t a = X_AXIS; a <= TERN(HAS_Y_AXIS, Y_AXIS, X_AXIS); ++a) {
switch (c.shaper[a]) {
case ftMotionShaper_NONE: ftshaper[a] = GET_TEXT_F(MSG_LCD_OFF); break;
case ftMotionShaper_ZV: ftshaper[a] = GET_TEXT_F(MSG_FTM_ZV); break;
case ftMotionShaper_ZVD: ftshaper[a] = GET_TEXT_F(MSG_FTM_ZVD); break;
case ftMotionShaper_ZVDD: ftshaper[a] = GET_TEXT_F(MSG_FTM_ZVDD); break;
case ftMotionShaper_ZVDDD: ftshaper[a] = GET_TEXT_F(MSG_FTM_ZVDDD);break;
case ftMotionShaper_EI: ftshaper[a] = GET_TEXT_F(MSG_FTM_EI); break;
case ftMotionShaper_2HEI: ftshaper[a] = GET_TEXT_F(MSG_FTM_2HEI); break;
case ftMotionShaper_3HEI: ftshaper[a] = GET_TEXT_F(MSG_FTM_3HEI); break;
case ftMotionShaper_MZV: ftshaper[a] = GET_TEXT_F(MSG_FTM_MZV); break;
}
}
#endif
#if HAS_DYNAMIC_FREQ
FSTR_P dmode;
switch (c.dynFreqMode) {
default:
case dynFreqMode_DISABLED: dmode = GET_TEXT_F(MSG_LCD_OFF); break;
case dynFreqMode_Z_BASED: dmode = GET_TEXT_F(MSG_FTM_Z_BASED); break;
case dynFreqMode_MASS_BASED: dmode = GET_TEXT_F(MSG_FTM_MASS_BASED); break;
}
#endif
START_MENU(); START_MENU();
BACK_ITEM(MSG_MOTION); BACK_ITEM(MSG_MOTION);
@ -458,7 +454,7 @@ void menu_move() {
#if HAS_DYNAMIC_FREQ #if HAS_DYNAMIC_FREQ
SUBMENU(MSG_FTM_DYN_MODE, menu_ftm_dyn_mode); SUBMENU(MSG_FTM_DYN_MODE, menu_ftm_dyn_mode);
MENU_ITEM_ADDON_START_RJ(dmode.length()); lcd_put_u8str(dmode); MENU_ITEM_ADDON_END(); MENU_ITEM_ADDON_START_RJ(11); lcd_put_u8str(dmode); MENU_ITEM_ADDON_END();
if (c.dynFreqMode != dynFreqMode_DISABLED) { if (c.dynFreqMode != dynFreqMode_DISABLED) {
#if HAS_X_AXIS #if HAS_X_AXIS
EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_FTM_DFREQ_K_N, &c.dynFreqK[X_AXIS], 0.0f, 20.0f); 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() {
END_MENU(); END_MENU();
} }
void menu_tune_ft_motion() {
ftm_menu_get_msg_strings();
ft_config_t &c = ftMotion.cfg;
START_MENU();
SUBMENU(MSG_FTM_MODE, menu_ftm_mode);
MENU_ITEM_ADDON_START_RJ(ftmode.length()); lcd_put_u8str(ftmode); MENU_ITEM_ADDON_END();
#if HAS_DYNAMIC_FREQ
SUBMENU(MSG_FTM_DYN_MODE, menu_ftm_dyn_mode);
MENU_ITEM_ADDON_START_RJ(dmode.length()); lcd_put_u8str(dmode); MENU_ITEM_ADDON_END();
#endif
#if HAS_EXTRUDERS
EDIT_ITEM(bool, MSG_LINEAR_ADVANCE, &c.linearAdvEna);
if (c.linearAdvEna) EDIT_ITEM(float62, MSG_ADVANCE_K, &c.linearAdvK, 0.0f, 1000.0f);
#endif
END_MENU();
}
#endif // FT_MOTION_MENU #endif // FT_MOTION_MENU
void menu_motion() { void menu_motion() {
#if ENABLED(FT_MOTION_MENU)
const bool is_busy = printer_busy();
#endif
START_MENU(); START_MENU();
// //
@ -532,7 +510,7 @@ void menu_motion() {
// M493 - Fixed-Time Motion // M493 - Fixed-Time Motion
// //
#if ENABLED(FT_MOTION_MENU) #if ENABLED(FT_MOTION_MENU)
SUBMENU(MSG_FIXED_TIME_MOTION, menu_ft_motion); if (!is_busy) SUBMENU(MSG_FIXED_TIME_MOTION, menu_ft_motion);
#endif #endif
// //

View File

@ -231,14 +231,6 @@ void menu_tune() {
#endif #endif
#endif #endif
//
// FT_MOTION
//
#if ENABLED(FT_MOTION_MENU)
extern void menu_tune_ft_motion();
SUBMENU(MSG_FIXED_TIME_MOTION, menu_tune_ft_motion);
#endif
END_MENU(); END_MENU();
} }