diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 76a08b8f3..069edc2e5 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -8233,11 +8233,17 @@ Sigma_Exit: /*! ### M914 - Set TMC2130 normal mode M914: Set TMC2130 normal mode */ +#ifdef TMC2130 case 914: { - tmc2130_mode = TMC2130_MODE_NORMAL; + printf_P(_n("tmc2130mode/smm/eep: %d %d %d\n"),tmc2130_mode,SilentModeMenu,eeprom_read_byte((uint8_t*)EEPROM_SILENT)); + if (tmc2130_mode != TMC2130_MODE_NORMAL) + { + tmc2130_mode = TMC2130_MODE_NORMAL; update_mode_profile(); tmc2130_init(TMCInitParams(false, FarmOrUserECool())); + printf_P(_n("tmc2130mode/smm/eep: %d %d %d\n"),tmc2130_mode,SilentModeMenu,eeprom_read_byte((uint8_t*)EEPROM_SILENT)); + } } break; @@ -8246,13 +8252,23 @@ Sigma_Exit: Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code. */ case 915: - { - tmc2130_mode = TMC2130_MODE_SILENT; - update_mode_profile(); - tmc2130_init(TMCInitParams(false, FarmOrUserECool())); + { + printf_P(_n("tmc2130mode/smm/eep: %d %d %d\n"),tmc2130_mode,SilentModeMenu,eeprom_read_byte((uint8_t*)EEPROM_SILENT)); + if (tmc2130_mode != TMC2130_MODE_SILENT) + { // This is basically the equivalent of force_high_power_mode for silent mode. + st_synchronize(); + cli(); + tmc2130_mode = TMC2130_MODE_SILENT; + update_mode_profile(); + tmc2130_init(TMCInitParams(false, FarmOrUserECool())); + printf_P(_n("tmc2130mode/smm/eep: %d %d %d\n"),tmc2130_mode,SilentModeMenu,eeprom_read_byte((uint8_t*)EEPROM_SILENT)); + st_reset_timer(); + sei(); + } } break; +#endif // TMC2130 #ifdef TMC2130_SERVICE_CODES_M910_M918 /*! ### M916 - Set TMC2130 Stallguard sensitivity threshold M916: Set TMC2130 Stallguard sensitivity threshold diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 69e445565..5c7b65511 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -4223,20 +4223,22 @@ do\ {\ if(!farm_mode)\ {\ - bool bDesync = SilentModeMenu != tmc2130_mode; \ - if (SilentModeMenu == SILENT_MODE_NORMAL && bDesync) \ - {\ - MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M915"), lcd_silent_mode_set);\ - }\ - else if (bDesync) \ - {\ - MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M914") , lcd_silent_mode_set);\ - }\ - else if (SilentModeMenu == SILENT_MODE_NORMAL)\ + /* M914/5 do not update eeprom, only tmc2130_mode */\ + bool bDesync = tmc2130_mode ^ eeprom_read_byte((uint8_t*)EEPROM_SILENT);\ + if (SilentModeMenu == SILENT_MODE_NORMAL) \ {\ - MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_NORMAL), lcd_silent_mode_set);\ + if (bDesync)\ + MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M915"), lcd_silent_mode_set);\ + else\ + MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_NORMAL), lcd_silent_mode_set);\ }\ - else MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_STEALTH), lcd_silent_mode_set);\ + else\ + {\ + if (bDesync)\ + MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M914") , lcd_silent_mode_set);\ + else\ + MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_STEALTH), lcd_silent_mode_set);\ + }\ if (SilentModeMenu == SILENT_MODE_NORMAL)\ {\ if (lcd_crash_detect_enabled()) MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), _T(MSG_ON), crash_mode_switch);\