Browse Source

Disable steppers on M112 (#15065)

And change verbiage to not refer to "Emergency Stop."
InsanityAutomation 4 years ago
parent
commit
b7796bcce6

+ 8
- 4
Marlin/src/Marlin.cpp View File

@@ -745,7 +745,7 @@ void idle(
745 745
  * Kill all activity and lock the machine.
746 746
  * After this the machine will need to be reset.
747 747
  */
748
-void kill(PGM_P const lcd_msg/*=nullptr*/) {
748
+void kill(PGM_P const lcd_msg/*=nullptr*/, const bool steppers_off/*=false*/) {
749 749
   thermalManager.disable_all_heaters();
750 750
 
751 751
   SERIAL_ERROR_MSG(MSG_ERR_KILLED);
@@ -760,10 +760,10 @@ void kill(PGM_P const lcd_msg/*=nullptr*/) {
760 760
     host_action_kill();
761 761
   #endif
762 762
 
763
-  minkill();
763
+  minkill(steppers_off);
764 764
 }
765 765
 
766
-void minkill() {
766
+void minkill(const bool steppers_off/*=false*/) {
767 767
 
768 768
   // Wait a short time (allows messages to get out before shutting down.
769 769
   for (int i = 1000; i--;) DELAY_US(600);
@@ -773,7 +773,11 @@ void minkill() {
773 773
   // Wait to ensure all interrupts stopped
774 774
   for (int i = 1000; i--;) DELAY_US(250);
775 775
 
776
-  thermalManager.disable_all_heaters(); // turn off heaters again
776
+  // Reiterate heaters off
777
+  thermalManager.disable_all_heaters();
778
+
779
+  // Power off all steppers (for M112) or just the E steppers
780
+  steppers_off ? disable_all_steppers() : disable_e_steppers();
777 781
 
778 782
   #if HAS_POWER_SWITCH
779 783
     PSU_OFF();

+ 2
- 2
Marlin/src/Marlin.h View File

@@ -322,8 +322,8 @@ void disable_e_stepper(const uint8_t e);
322 322
 void disable_e_steppers();
323 323
 void disable_all_steppers();
324 324
 
325
-void kill(PGM_P const lcd_msg=nullptr);
326
-void minkill();
325
+void kill(PGM_P const lcd_msg=nullptr, const bool steppers_off=false);
326
+void minkill(const bool steppers_off=false);
327 327
 
328 328
 void quickstop_stepper();
329 329
 

+ 2
- 2
Marlin/src/gcode/control/M108_M112_M410.cpp View File

@@ -38,10 +38,10 @@ void GcodeSuite::M108() {
38 38
 }
39 39
 
40 40
 /**
41
- * M112: Emergency Stop
41
+ * M112: Full Shutdown
42 42
  */
43 43
 void GcodeSuite::M112() {
44
-  kill();
44
+  kill(PSTR("M112 Shutdown"), true);
45 45
 }
46 46
 
47 47
 /**

+ 1
- 1
Marlin/src/gcode/control/M80_M81.cpp View File

@@ -86,7 +86,7 @@
86 86
 /**
87 87
  * M81: Turn off Power, including Power Supply, if there is one.
88 88
  *
89
- *      This code should ALWAYS be available for EMERGENCY SHUTDOWN!
89
+ *      This code should ALWAYS be available for FULL SHUTDOWN!
90 90
  */
91 91
 void GcodeSuite::M81() {
92 92
   thermalManager.disable_all_heaters();

+ 1
- 1
Marlin/src/gcode/gcode.cpp View File

@@ -407,7 +407,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
407 407
 
408 408
       #if DISABLED(EMERGENCY_PARSER)
409 409
         case 108: M108(); break;                                  // M108: Cancel Waiting
410
-        case 112: M112(); break;                                  // M112: Emergency Stop
410
+        case 112: M112(); break;                                  // M112: Full Shutdown
411 411
         case 410: M410(); break;                                  // M410: Quickstop - Abort all the planned moves.
412 412
         #if ENABLED(HOST_PROMPT_SUPPORT)
413 413
           case 876: M876(); break;                                  // M876: Handle Host prompt responses

+ 1
- 1
Marlin/src/gcode/gcode.h View File

@@ -132,7 +132,7 @@
132 132
  *        If AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
133 133
  * M110 - Set the current line number. (Used by host printing)
134 134
  * M111 - Set debug flags: "M111 S<flagbits>". See flag bits defined in enum.h.
135
- * M112 - Emergency stop.
135
+ * M112 - Full Shutdown.
136 136
  * M113 - Get or set the timeout interval for Host Keepalive "busy" messages. (Requires HOST_KEEPALIVE_FEATURE)
137 137
  * M114 - Report current position.
138 138
  * M115 - Report capabilities. (Extended capabilities requires EXTENDED_CAPABILITIES_REPORT)

+ 2
- 2
Marlin/src/module/planner.h View File

@@ -715,8 +715,8 @@ class Planner {
715 715
       FORCE_INLINE static float get_axis_position_degrees(const AxisEnum axis) { return get_axis_position_mm(axis); }
716 716
     #endif
717 717
 
718
-    // Called to force a quick stop of the machine (for example, when an emergency
719
-    // stop is required, or when endstops are hit)
718
+    // Called to force a quick stop of the machine (for example, when
719
+    // a Full Shutdown is required, or when endstops are hit)
720 720
     static void quick_stop();
721 721
 
722 722
     // Called when an endstop is triggered. Causes the machine to stop inmediately

Loading…
Cancel
Save