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).
This commit is contained in:
Yuri D'Elia 2022-08-20 16:00:03 +02:00 committed by Guðni Már Gilbert
parent 5d880919f8
commit dece5d268f
2 changed files with 6 additions and 7 deletions

View File

@ -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;

View File

@ -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
}