diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 7dd853cbad..38b69dab0d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -8199,13 +8199,17 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { } void kill(const char* lcd_msg) { + SERIAL_ERROR_START; + SERIAL_ERRORLNPGM(MSG_ERR_KILLED); + #if ENABLED(ULTRA_LCD) - lcd_init(); - lcd_setalertstatuspgm(lcd_msg); + kill_screen(lcd_msg); #else UNUSED(lcd_msg); #endif + for (int i = 5; i--;) delay(100); // Wait a short time + cli(); // Stop interrupts thermalManager.disable_all_heaters(); disable_all_steppers(); @@ -8214,13 +8218,6 @@ void kill(const char* lcd_msg) { pinMode(PS_ON_PIN, INPUT); #endif - SERIAL_ERROR_START; - SERIAL_ERRORLNPGM(MSG_ERR_KILLED); - - // FMC small patch to update the LCD before ending - sei(); // enable interrupts - for (int i = 5; i--; lcd_update()) delay(200); // Wait a short time - cli(); // disable interrupts suicide(); while (1) { #if ENABLED(USE_WATCHDOG) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index ffe6a52ab8..c71213a223 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -290,6 +290,16 @@ static void lcd_implementation_init() { #endif } +void lcd_kill_screen() { + lcd_setFont(FONT_MENU); + u8g.setPrintPos(0, u8g.getHeight()/4*1); + lcd_print(lcd_status_message); + u8g.setPrintPos(0, u8g.getHeight()/4*2); + lcd_printPGM(PSTR(MSG_HALTED)); + u8g.setPrintPos(0, u8g.getHeight()/4*3); + lcd_printPGM(PSTR(MSG_PLEASE_RESET)); +} + static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop FORCE_INLINE void _draw_centered_temp(int temp, int x, int y) { diff --git a/Marlin/language_en.h b/Marlin/language_en.h index f69ef9ca3b..a82da89bdd 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -487,6 +487,12 @@ #ifndef MSG_ERR_MINTEMP_BED #define MSG_ERR_MINTEMP_BED "Err: MINTEMP BED" #endif +#ifndef MSG_HALTED + #define MSG_HALTED "PRINTER HALTED" +#endif +#ifndef MSG_PLEASE_RESET + #define MSG_PLEASE_RESET "Please reset" +#endif #ifndef MSG_END_HOUR #define MSG_END_HOUR "hours" #endif diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index e7a59d4cc5..d0a9a5dd73 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -530,6 +530,24 @@ static void lcd_status_screen() { #endif //ULTIPANEL } +/** + * + * draw the kill screen + * + */ +void kill_screen(const char* lcd_msg) { + lcd_init(); + lcd_setalertstatuspgm(lcd_msg); + #if ENABLED(DOGLCD) + u8g.firstPage(); + do { + lcd_kill_screen(); + } while (u8g.nextPage()); + #else + lcd_kill_screen(); + #endif +} + #if ENABLED(ULTIPANEL) inline void line_to_current(AxisEnum axis) { diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 40b09606ae..fde78c0b1f 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -40,6 +40,8 @@ void lcd_setalertstatuspgm(const char* message); void lcd_reset_alert_level(); bool lcd_detected(void); + void lcd_kill_screen(); + void kill_screen(const char* lcd_msg); #if ENABLED(LCD_USE_I2C_BUZZER) void lcd_buzz(long duration, uint16_t freq); diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index edb496e2eb..7f7bee5492 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -572,6 +572,19 @@ unsigned lcd_print(char c) { return charset_mapper(c); } #endif // SHOW_BOOTSCREEN +void lcd_kill_screen() { + lcd.setCursor(0, 0); + lcd_print(lcd_status_message); + #if LCD_HEIGHT < 4 + lcd.setCursor(0, 2); + #else + lcd.setCursor(0, 2); + lcd_printPGM(PSTR(MSG_HALTED)); + lcd.setCursor(0, 3); + #endif + lcd_printPGM(PSTR(MSG_PLEASE_RESET)); +} + FORCE_INLINE void _draw_axis_label(AxisEnum axis, const char *pstr, bool blink) { if (blink) lcd_printPGM(pstr);