Browse Source

Fix: M112 calling kill from interrupt (#9923)

Fix #9906
pull/1/head
Scott Lahteine 7 years ago
committed by GitHub
parent
commit
649f375494
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp
  2. 4
      Marlin/src/HAL/HAL_AVR/MarlinSerial.h
  3. 4
      Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.cpp
  4. 4
      Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.h
  5. 4
      Marlin/src/module/temperature.cpp

4
Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp

@ -81,6 +81,8 @@
#if ENABLED(EMERGENCY_PARSER) #if ENABLED(EMERGENCY_PARSER)
bool killed_by_M112; // = false
#include "../../module/stepper.h" #include "../../module/stepper.h"
// Currently looking for: M108, M112, M410 // Currently looking for: M108, M112, M410
@ -155,7 +157,7 @@
wait_for_user = wait_for_heatup = false; wait_for_user = wait_for_heatup = false;
break; break;
case state_M112: case state_M112:
kill(PSTR(MSG_KILLED)); killed_by_M112 = true;
break; break;
case state_M410: case state_M410:
quickstop_stepper(); quickstop_stepper();

4
Marlin/src/HAL/HAL_AVR/MarlinSerial.h

@ -94,6 +94,10 @@
extern ring_buffer_pos_t rx_max_enqueued; extern ring_buffer_pos_t rx_max_enqueued;
#endif #endif
#if ENABLED(EMERGENCY_PARSER)
extern bool killed_by_M112;
#endif
class MarlinSerial { //: public Stream class MarlinSerial { //: public Stream
public: public:

4
Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.cpp

@ -108,6 +108,8 @@
#if ENABLED(EMERGENCY_PARSER) #if ENABLED(EMERGENCY_PARSER)
bool killed_by_M112; // = false
// Currently looking for: M108, M112, M410 // Currently looking for: M108, M112, M410
// If you alter the parser please don't forget to update the capabilities in Conditionals_post.h // If you alter the parser please don't forget to update the capabilities in Conditionals_post.h
@ -180,7 +182,7 @@
wait_for_user = wait_for_heatup = false; wait_for_user = wait_for_heatup = false;
break; break;
case state_M112: case state_M112:
kill(PSTR(MSG_KILLED)); killed_by_M112 = true;
break; break;
case state_M410: case state_M410:
quickstop_stepper(); quickstop_stepper();

4
Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.h

@ -74,6 +74,10 @@
extern ring_buffer_pos_t rx_max_enqueued; extern ring_buffer_pos_t rx_max_enqueued;
#endif #endif
#if ENABLED(EMERGENCY_PARSER)
extern bool killed_by_M112;
#endif
class MarlinSerial { class MarlinSerial {
public: public:

4
Marlin/src/module/temperature.cpp

@ -750,6 +750,10 @@ void Temperature::manage_heater() {
static bool last_pause_state; static bool last_pause_state;
#endif #endif
#if ENABLED(EMERGENCY_PARSER)
if (killed_by_M112) kill(PSTR(MSG_KILLED));
#endif
if (!temp_meas_ready) return; if (!temp_meas_ready) return;
updateTemperaturesFromRawValues(); // also resets the watchdog updateTemperaturesFromRawValues(); // also resets the watchdog

Loading…
Cancel
Save