AnHardt преди 9 години
родител
ревизия
faac2bcfdb
променени са 6 файла, в които са добавени 55 реда и са изтрити 9 реда
  1. 6
    9
      Marlin/Marlin_main.cpp
  2. 10
    0
      Marlin/dogm_lcd_implementation.h
  3. 6
    0
      Marlin/language_en.h
  4. 18
    0
      Marlin/ultralcd.cpp
  5. 2
    0
      Marlin/ultralcd.h
  6. 13
    0
      Marlin/ultralcd_implementation_hitachi_HD44780.h

+ 6
- 9
Marlin/Marlin_main.cpp Целия файл

8265
 }
8265
 }
8266
 
8266
 
8267
 void kill(const char* lcd_msg) {
8267
 void kill(const char* lcd_msg) {
8268
+  SERIAL_ERROR_START;
8269
+  SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
8270
+
8268
   #if ENABLED(ULTRA_LCD)
8271
   #if ENABLED(ULTRA_LCD)
8269
-    lcd_init();
8270
-    lcd_setalertstatuspgm(lcd_msg);
8272
+    kill_screen(lcd_msg);
8271
   #else
8273
   #else
8272
     UNUSED(lcd_msg);
8274
     UNUSED(lcd_msg);
8273
   #endif
8275
   #endif
8274
 
8276
 
8277
+  for (int i = 5; i--;) delay(100); // Wait a short time
8278
+
8275
   cli(); // Stop interrupts
8279
   cli(); // Stop interrupts
8276
   thermalManager.disable_all_heaters();
8280
   thermalManager.disable_all_heaters();
8277
   disable_all_steppers();
8281
   disable_all_steppers();
8280
     pinMode(PS_ON_PIN, INPUT);
8284
     pinMode(PS_ON_PIN, INPUT);
8281
   #endif
8285
   #endif
8282
 
8286
 
8283
-  SERIAL_ERROR_START;
8284
-  SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
8285
-
8286
-  // FMC small patch to update the LCD before ending
8287
-  sei();   // enable interrupts
8288
-  for (int i = 5; i--; lcd_update()) delay(200); // Wait a short time
8289
-  cli();   // disable interrupts
8290
   suicide();
8287
   suicide();
8291
   while (1) {
8288
   while (1) {
8292
     #if ENABLED(USE_WATCHDOG)
8289
     #if ENABLED(USE_WATCHDOG)

+ 10
- 0
Marlin/dogm_lcd_implementation.h Целия файл

290
   #endif
290
   #endif
291
 }
291
 }
292
 
292
 
293
+void lcd_kill_screen() {
294
+  lcd_setFont(FONT_MENU);
295
+  u8g.setPrintPos(0, u8g.getHeight()/4*1);
296
+  lcd_print(lcd_status_message);
297
+  u8g.setPrintPos(0, u8g.getHeight()/4*2);
298
+  lcd_printPGM(PSTR(MSG_HALTED));
299
+  u8g.setPrintPos(0, u8g.getHeight()/4*3);
300
+  lcd_printPGM(PSTR(MSG_PLEASE_RESET));
301
+}
302
+
293
 static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
303
 static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
294
 
304
 
295
 FORCE_INLINE void _draw_centered_temp(int temp, int x, int y) {
305
 FORCE_INLINE void _draw_centered_temp(int temp, int x, int y) {

+ 6
- 0
Marlin/language_en.h Целия файл

487
 #ifndef MSG_ERR_MINTEMP_BED
487
 #ifndef MSG_ERR_MINTEMP_BED
488
   #define MSG_ERR_MINTEMP_BED                 "Err: MINTEMP BED"
488
   #define MSG_ERR_MINTEMP_BED                 "Err: MINTEMP BED"
489
 #endif
489
 #endif
490
+#ifndef MSG_HALTED
491
+  #define MSG_HALTED                          "PRINTER HALTED"
492
+#endif
493
+#ifndef MSG_PLEASE_RESET
494
+  #define MSG_PLEASE_RESET                    "Please reset"
495
+#endif
490
 #ifndef MSG_END_HOUR
496
 #ifndef MSG_END_HOUR
491
   #define MSG_END_HOUR                        "hours"
497
   #define MSG_END_HOUR                        "hours"
492
 #endif
498
 #endif

+ 18
- 0
Marlin/ultralcd.cpp Целия файл

530
   #endif //ULTIPANEL
530
   #endif //ULTIPANEL
531
 }
531
 }
532
 
532
 
533
+/**
534
+ *
535
+ * draw the kill screen
536
+ *
537
+ */
538
+void kill_screen(const char* lcd_msg) {
539
+  lcd_init();
540
+  lcd_setalertstatuspgm(lcd_msg);
541
+  #if ENABLED(DOGLCD)
542
+    u8g.firstPage();
543
+    do {
544
+      lcd_kill_screen();
545
+    } while (u8g.nextPage());
546
+  #else
547
+    lcd_kill_screen();
548
+  #endif
549
+}
550
+
533
 #if ENABLED(ULTIPANEL)
551
 #if ENABLED(ULTIPANEL)
534
 
552
 
535
   inline void line_to_current(AxisEnum axis) {
553
   inline void line_to_current(AxisEnum axis) {

+ 2
- 0
Marlin/ultralcd.h Целия файл

40
   void lcd_setalertstatuspgm(const char* message);
40
   void lcd_setalertstatuspgm(const char* message);
41
   void lcd_reset_alert_level();
41
   void lcd_reset_alert_level();
42
   bool lcd_detected(void);
42
   bool lcd_detected(void);
43
+  void lcd_kill_screen();
44
+  void kill_screen(const char* lcd_msg);
43
 
45
 
44
   #if ENABLED(LCD_USE_I2C_BUZZER)
46
   #if ENABLED(LCD_USE_I2C_BUZZER)
45
     void lcd_buzz(long duration, uint16_t freq);
47
     void lcd_buzz(long duration, uint16_t freq);

+ 13
- 0
Marlin/ultralcd_implementation_hitachi_HD44780.h Целия файл

572
 
572
 
573
 #endif // SHOW_BOOTSCREEN
573
 #endif // SHOW_BOOTSCREEN
574
 
574
 
575
+void lcd_kill_screen() {
576
+  lcd.setCursor(0, 0);
577
+  lcd_print(lcd_status_message);
578
+  #if LCD_HEIGHT < 4
579
+    lcd.setCursor(0, 2);
580
+  #else
581
+    lcd.setCursor(0, 2);
582
+    lcd_printPGM(PSTR(MSG_HALTED));
583
+    lcd.setCursor(0, 3);
584
+  #endif
585
+  lcd_printPGM(PSTR(MSG_PLEASE_RESET));
586
+}
587
+
575
 FORCE_INLINE void _draw_axis_label(AxisEnum axis, const char *pstr, bool blink) {
588
 FORCE_INLINE void _draw_axis_label(AxisEnum axis, const char *pstr, bool blink) {
576
   if (blink)
589
   if (blink)
577
     lcd_printPGM(pstr);
590
     lcd_printPGM(pstr);

Loading…
Отказ
Запис