From 466e5623605cc6fa07dc4bf3e5564babb44c99ac Mon Sep 17 00:00:00 2001 From: gudnimg Date: Sun, 15 Oct 2023 12:17:36 +0000 Subject: [PATCH 1/2] PFW-1542 Don't allow starting SD print if there is a fan error Apply same conditions as on "Resume print" feature. Starting a SD print should not be possible if there is an active hardware error --- Firmware/ultralcd.cpp | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 9d3a3bd5a..835e718e5 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5222,25 +5222,34 @@ static void lcd_main_menu() MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); } #endif + + // only allow starting SD print if hardware errors (temperature or fan) are cleared + if(!get_temp_error() +#ifdef FANCHECK + && fan_check_error != EFCE_REPORTED +#endif //FANCHECK + ) + { #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code - if (card.cardOK || lcd_commands_type != LcdCommands::Idle) { - if (!card.isFileOpen()) { - 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); - } + if (card.cardOK || lcd_commands_type != LcdCommands::Idle) { + if (!card.isFileOpen()) { + 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); + } #if SDCARDDETECT < 1 - MENU_ITEM_GCODE_P(_i("Change SD card"), PSTR("M21")); // SD-card changed by user ////MSG_CNG_SDCARD c=18 + MENU_ITEM_GCODE_P(_i("Change SD card"), PSTR("M21")); // SD-card changed by user ////MSG_CNG_SDCARD c=18 +#endif //SDCARDDETECT + } + } else { + bMain=true; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function + MENU_ITEM_SUBMENU_P(_i("No SD card"), lcd_sdcard_menu); ////MSG_NO_CARD c=18 +#if SDCARDDETECT < 1 + MENU_ITEM_GCODE_P(_i("Init. SD card"), PSTR("M21")); // Manually initialize the SD-card via user interface ////MSG_INIT_SDCARD c=18 #endif //SDCARDDETECT } - } else { - bMain=true; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function - MENU_ITEM_SUBMENU_P(_i("No SD card"), lcd_sdcard_menu); ////MSG_NO_CARD c=18 -#if SDCARDDETECT < 1 - MENU_ITEM_GCODE_P(_i("Init. SD card"), PSTR("M21")); // Manually initialize the SD-card via user interface ////MSG_INIT_SDCARD c=18 -#endif //SDCARDDETECT - } #endif //SDSUPPORT + } if(!printer_active() && !farm_mode) { const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); From 20a434dbac493895f4bdf38351dbec0638b149fc Mon Sep 17 00:00:00 2001 From: gudnimg Date: Sun, 15 Oct 2023 12:26:44 +0000 Subject: [PATCH 2/2] PFW-1542 Reset status line message on EFCE_OK If the error is really resolved, I'd prefer to see "Prusa i3 MK3S OK" instead of "Err:HOTEND FAN ERROR" --- Firmware/fancheck.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Firmware/fancheck.cpp b/Firmware/fancheck.cpp index eedc5fe3d..1afcd35df 100755 --- a/Firmware/fancheck.cpp +++ b/Firmware/fancheck.cpp @@ -146,6 +146,7 @@ void checkFanSpeed() if ((fan_check_error == EFCE_FIXED) && !printer_active()){ fan_check_error = EFCE_OK; //if the issue is fixed while the printer is doing nothing, reenable processing immediately. lcd_reset_alert_level(); //for another fan speed error + lcd_setstatuspgm(MSG_WELCOME); // Reset the status line message to visually show the error is gone } if (fans_check_enabled && (fan_check_error == EFCE_OK)) {