From dece5d268f4c4a77e2b2e54ea252d7a4444663ea Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sat, 20 Aug 2022 16:00:03 +0200 Subject: [PATCH] Consider any lcd_custom_command to be "ACTIVE" All custom commands are transitory and eventually switch back to Idle state by themselves. It doesn't make any sense to explicitly check for Layer1Cal: any non-idle state is active by design. Fix this check in the main menu. This is probably incomplete (Layer1Cal is incorrectly used in several other places). --- Firmware/Marlin_main.cpp | 3 +-- Firmware/ultralcd.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index f9d6680fd..cf72c0bf3 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -513,9 +513,8 @@ bool __attribute__((noinline)) printJobOngoing() { bool __attribute__((noinline)) printer_active() { return printJobOngoing() || isPrintPaused - || (custom_message_type == CustomMsg::TempCal) || saved_printing - || (lcd_commands_type == LcdCommands::Layer1Cal) + || (lcd_commands_type != LcdCommands::Idle) || MMU2::mmu2.MMU_PRINT_SAVED() || homing_flag || mesh_bed_leveling_flag; diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 4bfc26538..25a193f3a 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5179,9 +5179,9 @@ static void lcd_main_menu() } #endif #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code - if (card.cardOK || lcd_commands_type == LcdCommands::Layer1Cal) { + if (card.cardOK || lcd_commands_type != LcdCommands::Idle) { if (!card.isFileOpen()) { - if (!usb_timer.running() && (lcd_commands_type != LcdCommands::Layer1Cal)) { + if (!usb_timer.running() && (lcd_commands_type == LcdCommands::Idle)) { bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu); } @@ -5198,7 +5198,7 @@ static void lcd_main_menu() } #endif //SDSUPPORT - if(!isPrintPaused && !printJobOngoing() && (lcd_commands_type != LcdCommands::Layer1Cal)) { + if(!isPrintPaused && !printJobOngoing() && (lcd_commands_type == LcdCommands::Idle)) { if (!farm_mode) { const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); @@ -5208,7 +5208,7 @@ static void lcd_main_menu() } } - if ( ! ( printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal || Stopped) ) ) { + if ( ! ( printJobOngoing() || (lcd_commands_type != LcdCommands::Idle) || Stopped) ) { if (MMU2::mmu2.Enabled()) { if(!MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) { // The MMU 'Load filament' state machine will reject the command if any @@ -5239,7 +5239,7 @@ static void lcd_main_menu() if(!isPrintPaused) MENU_ITEM_SUBMENU_P(_T(MSG_CALIBRATION), lcd_calibration_menu); } - if (!usb_timer.running() && (lcd_commands_type != LcdCommands::Layer1Cal)) { + if (!usb_timer.running() && (lcd_commands_type == LcdCommands::Idle)) { MENU_ITEM_SUBMENU_P(_i("Statistics"), lcd_menu_statistics);////MSG_STATISTICS c=18 }