Merge pull request #2130 from AnHardt/kill2

Add a string parameter to kill()
master
AnHardt 10 years ago
commit 4113762062

@ -220,7 +220,7 @@ void ok_to_send();
#endif
void reset_bed_level();
void prepare_move();
void kill();
void kill(const char *);
void Stop();
#ifdef FILAMENT_RUNOUT_SENSOR

@ -838,7 +838,7 @@ void get_command() {
}
// If command was e-stop process now
if (strcmp(command, "M112") == 0) kill();
if (strcmp(command, "M112") == 0) kill(PSTR(MSG_KILLED));
cmd_queue_index_w = (cmd_queue_index_w + 1) % BUFSIZE;
commands_in_queue += 1;
@ -3593,7 +3593,7 @@ inline void gcode_M111() {
/**
* M112: Emergency Stop
*/
inline void gcode_M112() { kill(); }
inline void gcode_M112() { kill(PSTR(MSG_KILLED)); }
#ifdef BARICUDA
@ -6244,7 +6244,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
millis_t ms = millis();
if (max_inactive_time && ms > previous_cmd_ms + max_inactive_time) kill();
if (max_inactive_time && ms > previous_cmd_ms + max_inactive_time) kill(PSTR(MSG_KILLED));
if (stepper_inactive_time && ms > previous_cmd_ms + stepper_inactive_time
&& !ignore_stepper_queue && !blocks_queued())
@ -6272,7 +6272,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
// Exceeded threshold and we can confirm that it was not accidental
// KILL the machine
// ----------------------------------------------------------------
if (killCount >= KILL_DELAY) kill();
if (killCount >= KILL_DELAY) kill(PSTR(MSG_KILLED));
#endif
#if HAS_HOME
@ -6373,11 +6373,13 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
check_axes_activity();
}
void kill()
{
void kill(const char *lcd_msg) {
#ifdef ULTRA_LCD
lcd_setalertstatuspgm(lcd_msg);
#endif
cli(); // Stop interrupts
disable_all_heaters();
disable_all_steppers();
#if HAS_POWER_SWITCH
@ -6386,7 +6388,6 @@ void kill()
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
LCD_ALERTMESSAGEPGM(MSG_KILLED);
// FMC small patch to update the LCD before ending
sei(); // enable interrupts

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

@ -724,7 +724,7 @@ static float analog2temp(int raw, uint8_t e) {
SERIAL_ERROR_START;
SERIAL_ERROR((int)e);
SERIAL_ERRORLNPGM(MSG_INVALID_EXTRUDER_NUM);
kill();
kill(PSTR(MSG_KILLED));
return 0.0;
}

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

Loading…
Cancel
Save