Procházet zdrojové kódy

Add a string parameter to kill()

Makes the output on the LCD adjustable.
AnHardt před 10 roky
rodič
revize
f4a93ed997
4 změnil soubory, kde provedl 10 přidání a 14 odebrání
  1. 1
    1
      Marlin/Marlin.h
  2. 7
    8
      Marlin/Marlin_main.cpp
  3. 1
    1
      Marlin/cardreader.cpp
  4. 1
    4
      Marlin/watchdog.cpp

+ 1
- 1
Marlin/Marlin.h Zobrazit soubor

@@ -220,7 +220,7 @@ void ok_to_send();
220 220
 #endif
221 221
 void reset_bed_level();
222 222
 void prepare_move();
223
-void kill();
223
+void kill(const char *);
224 224
 void Stop();
225 225
 
226 226
 #ifdef FILAMENT_RUNOUT_SENSOR

+ 7
- 8
Marlin/Marlin_main.cpp Zobrazit soubor

@@ -838,7 +838,7 @@ void get_command() {
838 838
       }
839 839
 
840 840
       // If command was e-stop process now
841
-      if (strcmp(command, "M112") == 0) kill();
841
+      if (strcmp(command, "M112") == 0) kill(PSTR(MSG_KILLED));
842 842
 
843 843
       cmd_queue_index_w = (cmd_queue_index_w + 1) % BUFSIZE;
844 844
       commands_in_queue += 1;
@@ -3593,7 +3593,7 @@ inline void gcode_M111() {
3593 3593
 /**
3594 3594
  * M112: Emergency Stop
3595 3595
  */
3596
-inline void gcode_M112() { kill(); }
3596
+inline void gcode_M112() { kill(PSTR(MSG_KILLED)); }
3597 3597
 
3598 3598
 #ifdef BARICUDA
3599 3599
 
@@ -6244,7 +6244,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
6244 6244
 
6245 6245
   millis_t ms = millis();
6246 6246
 
6247
-  if (max_inactive_time && ms > previous_cmd_ms + max_inactive_time) kill();
6247
+  if (max_inactive_time && ms > previous_cmd_ms + max_inactive_time) kill(PSTR(MSG_KILLED));
6248 6248
 
6249 6249
   if (stepper_inactive_time && ms > previous_cmd_ms + stepper_inactive_time
6250 6250
       && !ignore_stepper_queue && !blocks_queued())
@@ -6272,7 +6272,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
6272 6272
     // Exceeded threshold and we can confirm that it was not accidental
6273 6273
     // KILL the machine
6274 6274
     // ----------------------------------------------------------------
6275
-    if (killCount >= KILL_DELAY) kill();
6275
+    if (killCount >= KILL_DELAY) kill(PSTR(MSG_KILLED));
6276 6276
   #endif
6277 6277
 
6278 6278
   #if HAS_HOME
@@ -6373,11 +6373,11 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
6373 6373
   check_axes_activity();
6374 6374
 }
6375 6375
 
6376
-void kill()
6377
-{
6376
+void kill(const char *lcd_msg) {
6377
+  lcd_setalertstatuspgm(lcd_msg);
6378
+
6378 6379
   cli(); // Stop interrupts
6379 6380
   disable_all_heaters();
6380
-
6381 6381
   disable_all_steppers();
6382 6382
 
6383 6383
   #if HAS_POWER_SWITCH
@@ -6386,7 +6386,6 @@ void kill()
6386 6386
 
6387 6387
   SERIAL_ERROR_START;
6388 6388
   SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
6389
-  LCD_ALERTMESSAGEPGM(MSG_KILLED);
6390 6389
   
6391 6390
   // FMC small patch to update the LCD before ending
6392 6391
   sei();   // enable interrupts

+ 1
- 1
Marlin/cardreader.cpp Zobrazit soubor

@@ -219,7 +219,7 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/)
219 219
        SERIAL_ERROR_START;
220 220
        SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:");
221 221
        SERIAL_ERRORLN(SD_PROCEDURE_DEPTH);
222
-       kill();
222
+       kill(PSTR(MSG_KILLED));
223 223
        return;
224 224
      }
225 225
 

+ 1
- 4
Marlin/watchdog.cpp Zobrazit soubor

@@ -43,12 +43,9 @@ void watchdog_reset()
43 43
 #ifdef WATCHDOG_RESET_MANUAL
44 44
 ISR(WDT_vect)
45 45
 { 
46
-    //TODO: This message gets overwritten by the kill() call
47
-    LCD_ALERTMESSAGEPGM("ERR:Please Reset");//16 characters so it fits on a 16x2 display
48
-    lcd_update();
49 46
     SERIAL_ERROR_START;
50 47
     SERIAL_ERRORLNPGM("Something is wrong, please turn off the printer.");
51
-    kill(); //kill blocks
48
+    kill(PSTR("ERR:Please Reset")); //kill blocks //16 characters so it fits on a 16x2 display
52 49
     while(1); //wait for user or serial reset
53 50
 }
54 51
 #endif//RESET_MANUAL

Loading…
Zrušit
Uložit