From 5c4ec5dd4f48760f5e2dbb29e13c74e56d57442b 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 d0c30d461..a3b292512 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -9612,9 +9612,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 c7865a83f2f53ee9c25e9fae65e6080f67f83d08 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 f41d19671..1ff5521e5 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 a588a5f695f0651f4fd84dbbea02c9754b985b21 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 1ff5521e5..ee08f4fc4 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 3066fd1db34e9cf6a6de018298f832c8dc60fa9b 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 ee08f4fc4..66f9ff42b 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 001876a80712b35a7b16e6b8b3da09970cd60391 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 66f9ff42b..c0636a76a 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 119dc10b8fe8f5fb9e1b8a3d5e75ea49e8b6ee37 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 8d510f80a..747a89a63 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -819,7 +819,7 @@ void lcd_status_screen() // NOT static due to using ins } } -void print_stop(); +void lcd_print_stop_finish(); void lcd_commands() { @@ -837,7 +837,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(); } } @@ -5863,7 +5863,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(); @@ -5908,9 +5908,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 6e2f016655586137977d87c87c09656bfb0e1a15 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 a3b292512..9e64dd7bd 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -666,7 +666,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(); @@ -7848,7 +7848,7 @@ Sigma_Exit: ### M603 - Stop print M603: Stop print */ case 603: { - lcd_print_stop(); + print_stop(); } break; @@ -9611,7 +9611,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 747a89a63..b3a7f5175 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5906,7 +5906,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 @@ -5925,11 +5925,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 937e950d6..761111d04 100755 --- a/Firmware/ultralcd.h +++ b/Firmware/ultralcd.h @@ -46,7 +46,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 365f845c99f4ac92b53d4e9e525fa78a467eb7dc 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 88d2af8fc..0b9bff3e1 100755 --- a/Firmware/temperature.cpp +++ b/Firmware/temperature.cpp @@ -2440,6 +2440,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 8d719efa797a72226a2353f4738ac3b59e8950e3 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 b3a7f5175..2f0f5cbcc 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -7503,13 +7503,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 0972ef70d0c9607a93935150cd9d574f99c84b0e 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 9e64dd7bd..c4664df36 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -9585,14 +9585,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); @@ -9625,13 +9625,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 0b9bff3e1..642dd4652 100755 --- a/Firmware/temperature.cpp +++ b/Firmware/temperature.cpp @@ -1764,7 +1764,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 f8290f25cd08f9f66110958fe2650d1296853072 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 80254ae62..ef68164ac 100644 --- a/Firmware/messages.cpp +++ b/Firmware/messages.cpp @@ -169,6 +169,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_LOAD_ALL[] PROGMEM_I1 = ISTR("Load All"); ////MSG_LOAD_ALL c=18 extern const char MSG_NOZZLE_CNG_MENU [] PROGMEM_I1 = ISTR("Nozzle change");////MSG_NOZZLE_CNG_MENU c=18 diff --git a/Firmware/messages.h b/Firmware/messages.h index 497824d80..e2129b342 100644 --- a/Firmware/messages.h +++ b/Firmware/messages.h @@ -173,6 +173,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_LOAD_ALL[]; extern const char MSG_NOZZLE_CNG_MENU []; diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 2f0f5cbcc..5d237d8c6 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5475,6 +5475,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 271523ad45019a7bc34e9a3451c79c2924104d75 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 --- Firmware/ultralcd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 5d237d8c6..ea38630f6 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5446,7 +5446,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 } @@ -5510,7 +5510,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 (MMU2::mmu2.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 80c7790e872d2cd42b9be1f9642eff3f519ff218 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 ea38630f6..f12d3ca50 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -7546,7 +7546,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 dba3428ef27f1a9472db0295074c20b14bdb9bb9 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 ef68164ac..c50bc36a7 100644 --- a/Firmware/messages.cpp +++ b/Firmware/messages.cpp @@ -169,7 +169,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_LOAD_ALL[] PROGMEM_I1 = ISTR("Load All"); ////MSG_LOAD_ALL c=18 extern const char MSG_NOZZLE_CNG_MENU [] PROGMEM_I1 = ISTR("Nozzle change");////MSG_NOZZLE_CNG_MENU c=18 diff --git a/Firmware/messages.h b/Firmware/messages.h index e2129b342..c5fa61392 100644 --- a/Firmware/messages.h +++ b/Firmware/messages.h @@ -173,7 +173,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_LOAD_ALL[]; extern const char MSG_NOZZLE_CNG_MENU []; diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index f12d3ca50..6d4c17f22 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5477,7 +5477,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