Bläddra i källkod

Echo LCD message to serial in kill

Scott Lahteine 4 år sedan
förälder
incheckning
1eb68e9f9a
1 ändrade filer med 7 tillägg och 6 borttagningar
  1. 7
    6
      Marlin/src/MarlinCore.cpp

+ 7
- 6
Marlin/src/MarlinCore.cpp Visa fil

@@ -825,18 +825,19 @@ void kill(PGM_P const lcd_error/*=nullptr*/, PGM_P const lcd_component/*=nullptr
825 825
 
826 826
   TERN_(HAS_CUTTER, cutter.kill()); // Full cutter shutdown including ISR control
827 827
 
828
-  SERIAL_ERROR_MSG(STR_ERR_KILLED);
828
+  // Echo the LCD message to serial for extra context
829
+  if (lcd_error) { SERIAL_ECHO_START(); SERIAL_ECHOLNPGM_P(lcd_error); }
829 830
 
830 831
   #if HAS_DISPLAY
831 832
     ui.kill_screen(lcd_error ?: GET_TEXT(MSG_KILLED), lcd_component ?: NUL_STR);
832 833
   #else
833
-    UNUSED(lcd_error);
834
-    UNUSED(lcd_component);
834
+    UNUSED(lcd_error); UNUSED(lcd_component);
835 835
   #endif
836 836
 
837
-  #if HAS_TFT_LVGL_UI
838
-    lv_draw_error_message(lcd_error);
839
-  #endif
837
+  TERN_(HAS_TFT_LVGL_UI, lv_draw_error_message(lcd_error));
838
+
839
+  // "Error:Printer halted. kill() called!"
840
+  SERIAL_ERROR_MSG(STR_ERR_KILLED);
840 841
 
841 842
   #ifdef ACTION_ON_KILL
842 843
     host_action_kill();

Laddar…
Avbryt
Spara