From c890c9e8b0697a33c53ddfbacf3b4679ee8022f6 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Tue, 13 Dec 2022 17:35:26 +0100 Subject: [PATCH 01/14] TM: Do not lockout the menus on thermal errors This prevents the ability to run gcode from the SD card. In a thermal error with faulty values, and without serial access, this is the only way to process an M310 instruction and recover. --- Firmware/Marlin_main.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 835cb89b..c3700902 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -9744,9 +9744,6 @@ void ThermalStop(bool allow_pause) } else { // We got a hard thermal error and/or there is no print going on. Just stop. lcd_print_stop(); - - // Also prevent further menu entry - menu_set_block(MENU_BLOCK_THERMAL_ERROR); } // Report the status on the serial, switch to a busy state From 42125b4bb219ca5a2232aa6faf8d87328a4e85b3 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Tue, 13 Dec 2022 23:33:41 +0100 Subject: [PATCH 02/14] Keep a pointer past the line number in cmdqueue This allows to skip line numbers transparently and perform faster checks on the actual command to process. --- Firmware/cmdqueue.cpp | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/Firmware/cmdqueue.cpp b/Firmware/cmdqueue.cpp index 31c0cb79..16d0e04c 100755 --- a/Firmware/cmdqueue.cpp +++ b/Firmware/cmdqueue.cpp @@ -366,22 +366,24 @@ void get_command() comment_mode = false; //for new command return; } - cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string + cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; // terminate string + char* cmd_head = cmdbuffer+bufindw+CMDHDRSIZE; // current command pointer + char* cmd_start = cmd_head; // pointer past the line number (if any) + if(!comment_mode){ - - long gcode_N = -1; + long gcode_N = -1; // seen line number // Line numbers must be first in buffer - if ((strstr_P(cmdbuffer+bufindw+CMDHDRSIZE, PSTR("PRUSA")) == NULL) && - (cmdbuffer[bufindw+CMDHDRSIZE] == 'N')) { + (*cmd_head == 'N')) { - // Line number met. When sending a G-code over a serial line, each line may be stamped with its index, - // and Marlin tests, whether the successive lines are stamped with an increasing line number ID - gcode_N = (strtol(cmdbuffer+bufindw+CMDHDRSIZE+1, NULL, 10)); - if(gcode_N != gcode_LastN+1 && (strstr_P(cmdbuffer+bufindw+CMDHDRSIZE, PSTR("M110")) == NULL) ) { - // M110 - set current line number. - // Line numbers not sent in succession. + // Line number met: decode the number, then move cmd_start past all spaces. + gcode_N = (strtol(cmd_head+1, &cmd_start, 10)); + while (*cmd_start == ' ') ++cmd_start; + + // Test whether the successive lines are stamped with an increasing line number ID. + if(gcode_N != gcode_LastN+1 && strncmp_P(cmd_start, PSTR("M110"), 4)) { + // Line numbers not sent in succession and M110 not seen. SERIAL_ERROR_START; SERIAL_ERRORRPGM(_n("Line Number is not Last Line Number+1, Last Line: "));////MSG_ERR_LINE_NO SERIAL_ERRORLN(gcode_LastN); @@ -391,10 +393,10 @@ void get_command() return; } - if((strchr_pointer = strchr(cmdbuffer+bufindw+CMDHDRSIZE, '*')) != NULL) + if((strchr_pointer = strchr(cmd_start, '*')) != NULL) { byte checksum = 0; - char *p = cmdbuffer+bufindw+CMDHDRSIZE; + char *p = cmd_head; while (p != strchr_pointer) checksum = checksum^(*p++); if (code_value_short() != (int16_t)checksum) { @@ -422,9 +424,8 @@ void get_command() cmdbuffer[bufindw + CMDHDRSIZE] = '$'; } // if we don't receive 'N' but still see '*' - if ((cmdbuffer[bufindw + CMDHDRSIZE] != 'N') && (cmdbuffer[bufindw + CMDHDRSIZE] != '$') && (strchr(cmdbuffer+bufindw+CMDHDRSIZE, '*') != NULL)) + if ((*cmd_head != 'N') && (cmdbuffer[bufindw + CMDHDRSIZE] != '$') && (strchr(cmd_start, '*') != NULL)) { - SERIAL_ERROR_START; SERIAL_ERRORRPGM(_n("No Line Number with checksum, Last Line: "));////MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM SERIAL_ERRORLN(gcode_LastN); @@ -432,15 +433,15 @@ void get_command() serial_count = 0; return; } + // Handle KILL early, even when Stopped - if(strcmp(cmdbuffer+bufindw+CMDHDRSIZE, "M112") == 0) + if(strcmp_P(cmd_start, PSTR("M112")) == 0) kill(MSG_M112_KILL, 2); + // Handle the USB timer - if ((strchr_pointer = strchr(cmdbuffer+bufindw+CMDHDRSIZE, 'G')) != NULL) { - if (!IS_SD_PRINTING) { - usb_timer.start(); - } - } + if ((*cmd_start == 'G') && !IS_SD_PRINTING) + usb_timer.start(); + if (Stopped == true) { // Stopped can be set either during error states (thermal error: cannot continue), or // when a printer-initiated action is processed. In such case the printer will send to From 5ab0dcb4c58f0abeed210b840c8ffb8d69d5e43a Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Wed, 14 Dec 2022 00:25:38 +0100 Subject: [PATCH 03/14] Allow M310 to bypass the Stopped state for recovery Since M310 cannot change the heaters, allowing M310 S0 (and changing parameters) allows to recover a usb-controlled printer which has been locked-out due to bad model settings. --- Firmware/cmdqueue.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Firmware/cmdqueue.cpp b/Firmware/cmdqueue.cpp index 16d0e04c..93cc792a 100755 --- a/Firmware/cmdqueue.cpp +++ b/Firmware/cmdqueue.cpp @@ -438,11 +438,16 @@ void get_command() if(strcmp_P(cmd_start, PSTR("M112")) == 0) kill(MSG_M112_KILL, 2); + // Bypass Stopped for some commands + bool allow_when_stopped = false; + if(strncmp_P(cmd_start, PSTR("M310"), 4) == 0) + allow_when_stopped = true; + // Handle the USB timer if ((*cmd_start == 'G') && !IS_SD_PRINTING) usb_timer.start(); - if (Stopped == true) { + if (allow_when_stopped == false && Stopped == true) { // Stopped can be set either during error states (thermal error: cannot continue), or // when a printer-initiated action is processed. In such case the printer will send to // the host an action, but cannot know if the action has been processed while new From de20fc6a5aef1194a8e0f8fcbe6fd19f01a8cdbe Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Thu, 15 Dec 2022 08:13:02 +0100 Subject: [PATCH 04/14] Replace two expressions with cmd_head --- Firmware/cmdqueue.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/cmdqueue.cpp b/Firmware/cmdqueue.cpp index 93cc792a..addc1e6e 100755 --- a/Firmware/cmdqueue.cpp +++ b/Firmware/cmdqueue.cpp @@ -421,10 +421,10 @@ void get_command() } // Don't parse N again with code_seen('N') - cmdbuffer[bufindw + CMDHDRSIZE] = '$'; + *cmd_head = '$'; } // if we don't receive 'N' but still see '*' - if ((*cmd_head != 'N') && (cmdbuffer[bufindw + CMDHDRSIZE] != '$') && (strchr(cmd_start, '*') != NULL)) + if ((*cmd_head != 'N') && (*cmd_head != '$') && (strchr(cmd_start, '*') != NULL)) { SERIAL_ERROR_START; SERIAL_ERRORRPGM(_n("No Line Number with checksum, Last Line: "));////MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM From d37a2a173a91c0ea68a72b1bea0adfa94a752e8f Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Thu, 15 Dec 2022 08:13:38 +0100 Subject: [PATCH 05/14] Parenthesize IS_SD_PRINTING defensively --- Firmware/cmdqueue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/cmdqueue.cpp b/Firmware/cmdqueue.cpp index addc1e6e..c2c634bb 100755 --- a/Firmware/cmdqueue.cpp +++ b/Firmware/cmdqueue.cpp @@ -444,7 +444,7 @@ void get_command() allow_when_stopped = true; // Handle the USB timer - if ((*cmd_start == 'G') && !IS_SD_PRINTING) + if ((*cmd_start == 'G') && !(IS_SD_PRINTING)) usb_timer.start(); if (allow_when_stopped == false && Stopped == true) { From 94583c861bde871c6ee1161b99d655763229db3d Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sat, 17 Dec 2022 16:03:03 +0100 Subject: [PATCH 06/14] Rename print_stop() to lcd_print_stop_finish() for clarity --- Firmware/ultralcd.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 6300bc8d..0aa5b623 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -835,7 +835,7 @@ void lcd_status_screen() // NOT static due to using ins } } -void print_stop(); +void lcd_print_stop_finish(); void lcd_commands() { @@ -853,7 +853,7 @@ void lcd_commands() lcd_setstatuspgm(_T(MSG_PRINT_ABORTED)); lcd_commands_type = LcdCommands::Idle; lcd_commands_step = 0; - print_stop(); + lcd_print_stop_finish(); } } @@ -6035,7 +6035,7 @@ static void lcd_sd_updir() } // continue stopping the print from the main loop after lcd_print_stop() is called -void print_stop() +void lcd_print_stop_finish() { // save printing time stoptime = _millis(); @@ -6069,9 +6069,9 @@ void print_stop() void lcd_print_stop() { - // UnconditionalStop() will internally cause planner_abort_hard(), meaning we _cannot_ plan - // any more move in this call! Any further move must happen inside print_stop(), which is called - // by the main loop one iteration later. + // UnconditionalStop() will internally cause planner_abort_hard(), meaning we _cannot_ plan any + // more move in this call! Any further move must happen inside lcd_print_stop_finish(), which is + // called by the main loop one iteration later. UnconditionalStop(); if (!card.sdprinting) { From 3b65aa06c564c9f81f5bd01d043b804c59655608 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sat, 17 Dec 2022 16:11:31 +0100 Subject: [PATCH 07/14] TM: Clear the Stopped state when stopping the current print We allow resuming from the LCD via start print and resume print, it makes sense to clear the error on stop too. For this reason distinguish whether the action is performed automatically or manually (ie: interactively). The error is only cleared when the command is run interactively. --- Firmware/Marlin_main.cpp | 6 +++--- Firmware/ultralcd.cpp | 12 +++++++++++- Firmware/ultralcd.h | 3 ++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index c3700902..f2c4a75c 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -678,7 +678,7 @@ void crashdet_cancel() saved_printing = false; tmc2130_sg_stop_on_crash = true; if (saved_printing_type == PRINTING_TYPE_SD) { - lcd_print_stop(); + print_stop(); }else if(saved_printing_type == PRINTING_TYPE_USB){ SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_CANCEL); //for Octoprint: works the same as clicking "Abort" button in Octoprint GUI cmdqueue_reset(); @@ -7913,7 +7913,7 @@ Sigma_Exit: ### M603 - Stop print M603: Stop print */ case 603: { - lcd_print_stop(); + print_stop(); } break; @@ -9743,7 +9743,7 @@ void ThermalStop(bool allow_pause) } } else { // We got a hard thermal error and/or there is no print going on. Just stop. - lcd_print_stop(); + print_stop(); } // Report the status on the serial, switch to a busy state diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 0aa5b623..74ca7144 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -6067,7 +6067,7 @@ void lcd_print_stop_finish() axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative } -void lcd_print_stop() +void print_stop(bool interactive) { // UnconditionalStop() will internally cause planner_abort_hard(), meaning we _cannot_ plan any // more move in this call! Any further move must happen inside lcd_print_stop_finish(), which is @@ -6086,11 +6086,21 @@ void lcd_print_stop() pause_time = 0; isPrintPaused = false; + if (interactive) { + // acknowledged by the user from the LCD: resume processing USB commands again + Stopped = false; + } + // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::StopPrint; lcd_return_to_status(); } +void lcd_print_stop() +{ + print_stop(true); +} + #ifdef TEMP_MODEL void lcd_temp_model_cal() { diff --git a/Firmware/ultralcd.h b/Firmware/ultralcd.h index 467acb3f..f45935fc 100755 --- a/Firmware/ultralcd.h +++ b/Firmware/ultralcd.h @@ -47,7 +47,8 @@ void lcd_sdcard_stop(); void lcd_pause_print(); void lcd_pause_usb_print(); void lcd_resume_print(); -void lcd_print_stop(); +void lcd_print_stop(); // interactive print stop +void print_stop(bool interactive=false); #ifdef TEMP_MODEL void lcd_temp_model_cal(); #endif //TEMP_MODEL From a551536386dadbc48289868984da9402dc5a4059 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sat, 17 Dec 2022 16:33:42 +0100 Subject: [PATCH 08/14] TM: correctly mark repeated anomalies --- Firmware/temperature.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Firmware/temperature.cpp b/Firmware/temperature.cpp index 42d5aa71..bb9fa8f1 100755 --- a/Firmware/temperature.cpp +++ b/Firmware/temperature.cpp @@ -2442,6 +2442,7 @@ void handle_warning() lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO); WRITE(BEEPER, HIGH); } + first = false; } else { if(warn_beep) TOGGLE(BEEPER); } From 5e50a15c887cf24c33453f3dc3548a8e91d23866 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sat, 17 Dec 2022 16:35:26 +0100 Subject: [PATCH 09/14] Do not show/call LCD status updates when unchanged This mostly prevents useless serial noise --- Firmware/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 74ca7144..c81a9952 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -7702,13 +7702,13 @@ void lcd_setalertstatus_(const char* message, uint8_t severity, bool progmem) bool same = !(progmem? strcmp_P(lcd_status_message, message): strcmp(lcd_status_message, message)); - lcd_updatestatus(message, progmem); lcd_status_message_timeout.start(); lcd_status_message_level = severity; custom_message_type = CustomMsg::Status; custom_message_state = 0; if (!same) { // do not kick the user out of the menus if the message is unchanged + lcd_updatestatus(message, progmem); lcd_return_to_status(); } } From 3c1c2fd2caf44dae28c02874b59a72d0311d9e1a Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sat, 17 Dec 2022 16:36:28 +0100 Subject: [PATCH 10/14] Use menu_set_block() in ThermalStop() Set a menu block for fatal thermal errors instead of abusing lcd_return_to_status() to kick the user out of the menus. This now allows a thermal model error to be recoverable through menu access. --- Firmware/Marlin_main.cpp | 22 ++++++++++++---------- Firmware/temperature.cpp | 1 - 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index f2c4a75c..1590e231 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -9717,14 +9717,14 @@ void UnconditionalStop() // WARNING: This function is called *continuously* during a thermal failure. // // This either pauses (for thermal model errors) or stops *without recovery* depending on -// "allow_pause". If pause is allowed, this forces a printer-initiated instantanenous pause (just -// like an LCD pause) that bypasses the host pausing functionality. In this state the printer is -// kept in busy state and *must* be recovered from the LCD. -void ThermalStop(bool allow_pause) +// "allow_recovery". If recovery is allowed, this forces a printer-initiated instantanenous pause +// (just like an LCD pause) that bypasses the host pausing functionality. In this state the printer +// is kept in busy state and *must* be recovered from the LCD. +void ThermalStop(bool allow_recovery) { if(Stopped == false) { Stopped = true; - if(allow_pause && (IS_SD_PRINTING || usb_timer.running())) { + if(allow_recovery && (IS_SD_PRINTING || usb_timer.running())) { if (!isPrintPaused) { lcd_setalertstatuspgm(_T(MSG_PAUSED_THERMAL_ERROR), LCD_STATUS_CRITICAL); @@ -9757,13 +9757,15 @@ void ThermalStop(bool allow_pause) // Make a warning sound! We cannot use Sound_MakeCustom as this would stop further moves. // Turn on the speaker here (if not already), and turn it off when back in the main loop. WRITE(BEEPER, HIGH); - } - // Return to the status screen to stop any pending menu action which could have been - // started by the user while stuck in the Stopped state. This also ensures the NEW - // error is immediately shown. - if (menu_menu != lcd_status_screen) + // Always return to the status screen to ensure the NEW error is immediately shown. lcd_return_to_status(); + + if(!allow_recovery) { + // prevent menu access for all fatal errors + menu_set_block(MENU_BLOCK_THERMAL_ERROR); + } + } } bool IsStopped() { return Stopped; }; diff --git a/Firmware/temperature.cpp b/Firmware/temperature.cpp index bb9fa8f1..04144b71 100755 --- a/Firmware/temperature.cpp +++ b/Firmware/temperature.cpp @@ -1766,7 +1766,6 @@ void handle_temp_error() } else { temp_error_state.v = 0; WRITE(BEEPER, LOW); - menu_unset_block(MENU_BLOCK_THERMAL_ERROR); // hotend error was transitory and disappeared, re-enable bed if (!target_temperature_bed) From 5fc277469ac90d3de191c6105746105cda2a4b4d Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sat, 17 Dec 2022 16:48:39 +0100 Subject: [PATCH 11/14] TM: Allow to resume without a running print If there is no running print, and the printer is Stopped, add a new "Acknowledge error" menu entry to unlock the printer. This simply calls lcd_print_stop(), which is identical in behavior to a thermal error with a running print. --- Firmware/messages.cpp | 1 + Firmware/messages.h | 1 + Firmware/ultralcd.cpp | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/Firmware/messages.cpp b/Firmware/messages.cpp index 5fc946ee..3ca3ce07 100644 --- a/Firmware/messages.cpp +++ b/Firmware/messages.cpp @@ -165,6 +165,7 @@ extern const char MSG_PAUSED_THERMAL_ERROR[] PROGMEM_I1 = ISTR("PAUSED THERMAL E #ifdef TEMP_MODEL extern const char MSG_THERMAL_ANOMALY[] PROGMEM_I1 = ISTR("THERMAL ANOMALY");////MSG_THERMAL_ANOMALY c=20 extern const char MSG_TM_NOT_CAL[] PROGMEM_I1 = ISTR("Temp model not calibrated yet.");////MSG_TM_NOT_CAL c=20 r=4 +extern const char MSG_ACK_ERROR[] PROGMEM_I1 = ISTR("Acknowledge error");////MSG_ACK_ERROR c=17 #endif extern const char MSG_NOZZLE_CNG_MENU [] PROGMEM_I1 = ISTR("Nozzle change");////MSG_NOZZLE_CNG_MENU c=18 extern const char MSG_NOZZLE_CNG_READ_HELP [] PROGMEM_I1 = ISTR("For a Nozzle change please read\nprusa.io/nozzle-mk3s");////MSG_NOZZLE_CNG_READ_HELP c=20 r=4 diff --git a/Firmware/messages.h b/Firmware/messages.h index 8197ac6f..83555248 100644 --- a/Firmware/messages.h +++ b/Firmware/messages.h @@ -169,6 +169,7 @@ extern const char MSG_PAUSED_THERMAL_ERROR[]; #ifdef TEMP_MODEL extern const char MSG_THERMAL_ANOMALY[]; extern const char MSG_TM_NOT_CAL[]; +extern const char MSG_ACK_ERROR[]; #endif extern const char MSG_NOZZLE_CNG_MENU []; extern const char MSG_NOZZLE_CNG_READ_HELP []; diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index c81a9952..88a2d9c6 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5637,6 +5637,11 @@ static void lcd_main_menu() if((IS_SD_PRINTING || usb_timer.running() || isPrintPaused) && (custom_message_type != CustomMsg::MeshBedLeveling)) { MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); } +#ifdef TEMP_MODEL + else if(Stopped) { + MENU_ITEM_SUBMENU_P(_T(MSG_ACK_ERROR), lcd_print_stop); + } +#endif #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code if (card.cardOK || lcd_commands_type == LcdCommands::Layer1Cal) { if (!card.isFileOpen()) { From 64eefa969ba6effdffd5d345ca8b0dbc17ae71dd Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sat, 17 Dec 2022 17:00:33 +0100 Subject: [PATCH 12/14] TM: Disallow preheat/filament actions when stopped Require acknowledgement first Fix cherry-pick mmu2 issue --- Firmware/ultralcd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 88a2d9c6..58c814f1 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5608,7 +5608,7 @@ static void lcd_main_menu() if ( moves_planned() || printer_active() ) { MENU_ITEM_SUBMENU_P(_i("Tune"), lcd_tune_menu);////MSG_TUNE c=18 - } else { + } else if (!Stopped) { MENU_ITEM_SUBMENU_P(_i("Preheat"), lcd_preheat_menu);////MSG_PREHEAT c=18 } @@ -5672,7 +5672,7 @@ static void lcd_main_menu() } } - if ( ! ( IS_SD_PRINTING || usb_timer.running() || (lcd_commands_type == LcdCommands::Layer1Cal) ) ) { + if ( ! ( IS_SD_PRINTING || usb_timer.running() || (lcd_commands_type == LcdCommands::Layer1Cal || Stopped) ) ) { if (mmu_enabled) { MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), mmu_load_filament_menu); MENU_ITEM_SUBMENU_P(_i("Load to nozzle"), mmu_load_to_nozzle_menu);////MSG_LOAD_TO_NOZZLE c=18 From 62d362f45f426f4b119cfbfa62a53da25027df66 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sat, 17 Dec 2022 17:30:44 +0100 Subject: [PATCH 13/14] Also prevent longpress when Stopped --- Firmware/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 58c814f1..151aba3a 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -7745,7 +7745,7 @@ void menu_lcd_longpress_func(void) // start LCD inactivity timer lcd_timeoutToStatus.start(); backlight_wake(); - if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_block_mask != MENU_BLOCK_NONE) + if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_block_mask != MENU_BLOCK_NONE || Stopped) { // disable longpress during re-entry, while homing, calibration or if a serious error lcd_quick_feedback(); From 7bf8a64d38822fdd77d8cbd08332cca127cfddb9 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sat, 17 Dec 2022 20:24:43 +0100 Subject: [PATCH 14/14] Improve MSG_ACK_ERROR message --- Firmware/messages.cpp | 2 +- Firmware/messages.h | 2 +- Firmware/ultralcd.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Firmware/messages.cpp b/Firmware/messages.cpp index 3ca3ce07..d4acdfa3 100644 --- a/Firmware/messages.cpp +++ b/Firmware/messages.cpp @@ -165,7 +165,7 @@ extern const char MSG_PAUSED_THERMAL_ERROR[] PROGMEM_I1 = ISTR("PAUSED THERMAL E #ifdef TEMP_MODEL extern const char MSG_THERMAL_ANOMALY[] PROGMEM_I1 = ISTR("THERMAL ANOMALY");////MSG_THERMAL_ANOMALY c=20 extern const char MSG_TM_NOT_CAL[] PROGMEM_I1 = ISTR("Temp model not calibrated yet.");////MSG_TM_NOT_CAL c=20 r=4 -extern const char MSG_ACK_ERROR[] PROGMEM_I1 = ISTR("Acknowledge error");////MSG_ACK_ERROR c=17 +extern const char MSG_TM_ACK_ERROR[] PROGMEM_I1 = ISTR("Clear TM error");////MSG_TM_ACK_ERROR c=18 #endif extern const char MSG_NOZZLE_CNG_MENU [] PROGMEM_I1 = ISTR("Nozzle change");////MSG_NOZZLE_CNG_MENU c=18 extern const char MSG_NOZZLE_CNG_READ_HELP [] PROGMEM_I1 = ISTR("For a Nozzle change please read\nprusa.io/nozzle-mk3s");////MSG_NOZZLE_CNG_READ_HELP c=20 r=4 diff --git a/Firmware/messages.h b/Firmware/messages.h index 83555248..410818b4 100644 --- a/Firmware/messages.h +++ b/Firmware/messages.h @@ -169,7 +169,7 @@ extern const char MSG_PAUSED_THERMAL_ERROR[]; #ifdef TEMP_MODEL extern const char MSG_THERMAL_ANOMALY[]; extern const char MSG_TM_NOT_CAL[]; -extern const char MSG_ACK_ERROR[]; +extern const char MSG_TM_ACK_ERROR[]; #endif extern const char MSG_NOZZLE_CNG_MENU []; extern const char MSG_NOZZLE_CNG_READ_HELP []; diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 151aba3a..b971bbde 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5639,7 +5639,7 @@ static void lcd_main_menu() } #ifdef TEMP_MODEL else if(Stopped) { - MENU_ITEM_SUBMENU_P(_T(MSG_ACK_ERROR), lcd_print_stop); + MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); } #endif #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code