Browse Source

Fix: M112 calling kill from interrupt (#9923)

Fix #9906
Scott Lahteine 7 years ago
parent
commit
649f375494
No account linked to committer's email address

+ 3
- 1
Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp View File

81
 
81
 
82
   #if ENABLED(EMERGENCY_PARSER)
82
   #if ENABLED(EMERGENCY_PARSER)
83
 
83
 
84
+    bool killed_by_M112; // = false
85
+
84
     #include "../../module/stepper.h"
86
     #include "../../module/stepper.h"
85
 
87
 
86
     // Currently looking for: M108, M112, M410
88
     // Currently looking for: M108, M112, M410
155
                 wait_for_user = wait_for_heatup = false;
157
                 wait_for_user = wait_for_heatup = false;
156
                 break;
158
                 break;
157
               case state_M112:
159
               case state_M112:
158
-                kill(PSTR(MSG_KILLED));
160
+                killed_by_M112 = true;
159
                 break;
161
                 break;
160
               case state_M410:
162
               case state_M410:
161
                 quickstop_stepper();
163
                 quickstop_stepper();

+ 4
- 0
Marlin/src/HAL/HAL_AVR/MarlinSerial.h View File

94
     extern ring_buffer_pos_t rx_max_enqueued;
94
     extern ring_buffer_pos_t rx_max_enqueued;
95
   #endif
95
   #endif
96
 
96
 
97
+  #if ENABLED(EMERGENCY_PARSER)
98
+    extern bool killed_by_M112;
99
+  #endif
100
+
97
   class MarlinSerial { //: public Stream
101
   class MarlinSerial { //: public Stream
98
 
102
 
99
     public:
103
     public:

+ 3
- 1
Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.cpp View File

108
 
108
 
109
   #if ENABLED(EMERGENCY_PARSER)
109
   #if ENABLED(EMERGENCY_PARSER)
110
 
110
 
111
+    bool killed_by_M112; // = false
112
+
111
     // Currently looking for: M108, M112, M410
113
     // Currently looking for: M108, M112, M410
112
     // If you alter the parser please don't forget to update the capabilities in Conditionals_post.h
114
     // If you alter the parser please don't forget to update the capabilities in Conditionals_post.h
113
 
115
 
180
                 wait_for_user = wait_for_heatup = false;
182
                 wait_for_user = wait_for_heatup = false;
181
                 break;
183
                 break;
182
               case state_M112:
184
               case state_M112:
183
-                kill(PSTR(MSG_KILLED));
185
+                killed_by_M112 = true;
184
                 break;
186
                 break;
185
               case state_M410:
187
               case state_M410:
186
                 quickstop_stepper();
188
                 quickstop_stepper();

+ 4
- 0
Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.h View File

74
   extern ring_buffer_pos_t rx_max_enqueued;
74
   extern ring_buffer_pos_t rx_max_enqueued;
75
 #endif
75
 #endif
76
 
76
 
77
+#if ENABLED(EMERGENCY_PARSER)
78
+  extern bool killed_by_M112;
79
+#endif
80
+
77
 class MarlinSerial {
81
 class MarlinSerial {
78
 
82
 
79
 public:
83
 public:

+ 4
- 0
Marlin/src/module/temperature.cpp View File

750
     static bool last_pause_state;
750
     static bool last_pause_state;
751
   #endif
751
   #endif
752
 
752
 
753
+  #if ENABLED(EMERGENCY_PARSER)
754
+    if (killed_by_M112) kill(PSTR(MSG_KILLED));
755
+  #endif
756
+
753
   if (!temp_meas_ready) return;
757
   if (!temp_meas_ready) return;
754
 
758
 
755
   updateTemperaturesFromRawValues(); // also resets the watchdog
759
   updateTemperaturesFromRawValues(); // also resets the watchdog

Loading…
Cancel
Save