瀏覽代碼

Add a string parameter to kill()

Makes the output on the LCD adjustable.
AnHardt 10 年之前
父節點
當前提交
f4a93ed997
共有 4 個檔案被更改,包括 10 行新增14 行删除
  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 查看文件

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

+ 7
- 8
Marlin/Marlin_main.cpp 查看文件

838
       }
838
       }
839
 
839
 
840
       // If command was e-stop process now
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
       cmd_queue_index_w = (cmd_queue_index_w + 1) % BUFSIZE;
843
       cmd_queue_index_w = (cmd_queue_index_w + 1) % BUFSIZE;
844
       commands_in_queue += 1;
844
       commands_in_queue += 1;
3593
 /**
3593
 /**
3594
  * M112: Emergency Stop
3594
  * M112: Emergency Stop
3595
  */
3595
  */
3596
-inline void gcode_M112() { kill(); }
3596
+inline void gcode_M112() { kill(PSTR(MSG_KILLED)); }
3597
 
3597
 
3598
 #ifdef BARICUDA
3598
 #ifdef BARICUDA
3599
 
3599
 
6244
 
6244
 
6245
   millis_t ms = millis();
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
   if (stepper_inactive_time && ms > previous_cmd_ms + stepper_inactive_time
6249
   if (stepper_inactive_time && ms > previous_cmd_ms + stepper_inactive_time
6250
       && !ignore_stepper_queue && !blocks_queued())
6250
       && !ignore_stepper_queue && !blocks_queued())
6272
     // Exceeded threshold and we can confirm that it was not accidental
6272
     // Exceeded threshold and we can confirm that it was not accidental
6273
     // KILL the machine
6273
     // KILL the machine
6274
     // ----------------------------------------------------------------
6274
     // ----------------------------------------------------------------
6275
-    if (killCount >= KILL_DELAY) kill();
6275
+    if (killCount >= KILL_DELAY) kill(PSTR(MSG_KILLED));
6276
   #endif
6276
   #endif
6277
 
6277
 
6278
   #if HAS_HOME
6278
   #if HAS_HOME
6373
   check_axes_activity();
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
   cli(); // Stop interrupts
6379
   cli(); // Stop interrupts
6379
   disable_all_heaters();
6380
   disable_all_heaters();
6380
-
6381
   disable_all_steppers();
6381
   disable_all_steppers();
6382
 
6382
 
6383
   #if HAS_POWER_SWITCH
6383
   #if HAS_POWER_SWITCH
6386
 
6386
 
6387
   SERIAL_ERROR_START;
6387
   SERIAL_ERROR_START;
6388
   SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
6388
   SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
6389
-  LCD_ALERTMESSAGEPGM(MSG_KILLED);
6390
   
6389
   
6391
   // FMC small patch to update the LCD before ending
6390
   // FMC small patch to update the LCD before ending
6392
   sei();   // enable interrupts
6391
   sei();   // enable interrupts

+ 1
- 1
Marlin/cardreader.cpp 查看文件

219
        SERIAL_ERROR_START;
219
        SERIAL_ERROR_START;
220
        SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:");
220
        SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:");
221
        SERIAL_ERRORLN(SD_PROCEDURE_DEPTH);
221
        SERIAL_ERRORLN(SD_PROCEDURE_DEPTH);
222
-       kill();
222
+       kill(PSTR(MSG_KILLED));
223
        return;
223
        return;
224
      }
224
      }
225
 
225
 

+ 1
- 4
Marlin/watchdog.cpp 查看文件

43
 #ifdef WATCHDOG_RESET_MANUAL
43
 #ifdef WATCHDOG_RESET_MANUAL
44
 ISR(WDT_vect)
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
     SERIAL_ERROR_START;
46
     SERIAL_ERROR_START;
50
     SERIAL_ERRORLNPGM("Something is wrong, please turn off the printer.");
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
     while(1); //wait for user or serial reset
49
     while(1); //wait for user or serial reset
53
 }
50
 }
54
 #endif//RESET_MANUAL
51
 #endif//RESET_MANUAL

Loading…
取消
儲存