Browse Source

Handle M410 in the main task (#19752)

Victor Oliveira 4 years ago
parent
commit
e370834c35
No account linked to committer's email address

+ 1
- 0
Marlin/src/feature/e_parser.cpp View File

@@ -32,6 +32,7 @@
32 32
 
33 33
 // Static data members
34 34
 bool EmergencyParser::killed_by_M112, // = false
35
+     EmergencyParser::quickstop_by_M410,
35 36
      EmergencyParser::enabled;
36 37
 
37 38
 #if ENABLED(HOST_PROMPT_SUPPORT)

+ 2
- 1
Marlin/src/feature/e_parser.h View File

@@ -63,6 +63,7 @@ public:
63 63
   };
64 64
 
65 65
   static bool killed_by_M112;
66
+  static bool quickstop_by_M410;
66 67
 
67 68
   #if ENABLED(HOST_PROMPT_SUPPORT)
68 69
     static uint8_t M876_reason;
@@ -168,7 +169,7 @@ public:
168 169
           if (enabled) switch (state) {
169 170
             case EP_M108: wait_for_user = wait_for_heatup = false; break;
170 171
             case EP_M112: killed_by_M112 = true; break;
171
-            case EP_M410: quickstop_stepper(); break;
172
+            case EP_M410: quickstop_by_M410 = true; break;
172 173
             #if ENABLED(HOST_PROMPT_SUPPORT)
173 174
               case EP_M876SN: host_response_handler(M876_reason); break;
174 175
             #endif

+ 8
- 2
Marlin/src/module/temperature.cpp View File

@@ -1032,8 +1032,14 @@ void Temperature::manage_heater() {
1032 1032
     if (!inited) return watchdog_refresh();
1033 1033
   #endif
1034 1034
 
1035
-  if (TERN0(EMERGENCY_PARSER, emergency_parser.killed_by_M112))
1036
-    kill(M112_KILL_STR, nullptr, true);
1035
+  #if ENABLED(EMERGENCY_PARSER)
1036
+    if (emergency_parser.killed_by_M112) kill(M112_KILL_STR, nullptr, true);
1037
+
1038
+    if (emergency_parser.quickstop_by_M410) {
1039
+      emergency_parser.quickstop_by_M410 = false; // quickstop_stepper may call idle so clear this now!
1040
+      quickstop_stepper();
1041
+    }
1042
+  #endif
1037 1043
 
1038 1044
   if (!raw_temps_ready) return;
1039 1045
 

Loading…
Cancel
Save