浏览代码

Disable steppers on M112 (#15065)

And change verbiage to not refer to "Emergency Stop."
InsanityAutomation 5 年前
父节点
当前提交
b7796bcce6

+ 8
- 4
Marlin/src/Marlin.cpp 查看文件

745
  * Kill all activity and lock the machine.
745
  * Kill all activity and lock the machine.
746
  * After this the machine will need to be reset.
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
   thermalManager.disable_all_heaters();
749
   thermalManager.disable_all_heaters();
750
 
750
 
751
   SERIAL_ERROR_MSG(MSG_ERR_KILLED);
751
   SERIAL_ERROR_MSG(MSG_ERR_KILLED);
760
     host_action_kill();
760
     host_action_kill();
761
   #endif
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
   // Wait a short time (allows messages to get out before shutting down.
768
   // Wait a short time (allows messages to get out before shutting down.
769
   for (int i = 1000; i--;) DELAY_US(600);
769
   for (int i = 1000; i--;) DELAY_US(600);
773
   // Wait to ensure all interrupts stopped
773
   // Wait to ensure all interrupts stopped
774
   for (int i = 1000; i--;) DELAY_US(250);
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
   #if HAS_POWER_SWITCH
782
   #if HAS_POWER_SWITCH
779
     PSU_OFF();
783
     PSU_OFF();

+ 2
- 2
Marlin/src/Marlin.h 查看文件

322
 void disable_e_steppers();
322
 void disable_e_steppers();
323
 void disable_all_steppers();
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
 void quickstop_stepper();
328
 void quickstop_stepper();
329
 
329
 

+ 2
- 2
Marlin/src/gcode/control/M108_M112_M410.cpp 查看文件

38
 }
38
 }
39
 
39
 
40
 /**
40
 /**
41
- * M112: Emergency Stop
41
+ * M112: Full Shutdown
42
  */
42
  */
43
 void GcodeSuite::M112() {
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 查看文件

86
 /**
86
 /**
87
  * M81: Turn off Power, including Power Supply, if there is one.
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
 void GcodeSuite::M81() {
91
 void GcodeSuite::M81() {
92
   thermalManager.disable_all_heaters();
92
   thermalManager.disable_all_heaters();

+ 1
- 1
Marlin/src/gcode/gcode.cpp 查看文件

407
 
407
 
408
       #if DISABLED(EMERGENCY_PARSER)
408
       #if DISABLED(EMERGENCY_PARSER)
409
         case 108: M108(); break;                                  // M108: Cancel Waiting
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
         case 410: M410(); break;                                  // M410: Quickstop - Abort all the planned moves.
411
         case 410: M410(); break;                                  // M410: Quickstop - Abort all the planned moves.
412
         #if ENABLED(HOST_PROMPT_SUPPORT)
412
         #if ENABLED(HOST_PROMPT_SUPPORT)
413
           case 876: M876(); break;                                  // M876: Handle Host prompt responses
413
           case 876: M876(); break;                                  // M876: Handle Host prompt responses

+ 1
- 1
Marlin/src/gcode/gcode.h 查看文件

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

+ 2
- 2
Marlin/src/module/planner.h 查看文件

715
       FORCE_INLINE static float get_axis_position_degrees(const AxisEnum axis) { return get_axis_position_mm(axis); }
715
       FORCE_INLINE static float get_axis_position_degrees(const AxisEnum axis) { return get_axis_position_mm(axis); }
716
     #endif
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
     static void quick_stop();
720
     static void quick_stop();
721
 
721
 
722
     // Called when an endstop is triggered. Causes the machine to stop inmediately
722
     // Called when an endstop is triggered. Causes the machine to stop inmediately

正在加载...
取消
保存