Browse Source

disable / enable_all_steppers functions

Scott Lahteine 9 years ago
parent
commit
b98ebd517e
5 changed files with 22 additions and 27 deletions
  1. 3
    0
      Marlin/Marlin.h
  2. 14
    10
      Marlin/Marlin_main.cpp
  3. 3
    3
      Marlin/planner.cpp
  4. 1
    7
      Marlin/stepper.cpp
  5. 1
    7
      Marlin/temperature.cpp

+ 3
- 0
Marlin/Marlin.h View File

@@ -179,6 +179,9 @@ void manage_inactivity(bool ignore_stepper_queue=false);
179 179
   #define disable_e3() /* nothing */
180 180
 #endif
181 181
 
182
+void enable_all_steppers();
183
+void disable_all_steppers();
184
+
182 185
 enum AxisEnum {X_AXIS=0, Y_AXIS=1, A_AXIS=0, B_AXIS=1, Z_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5};
183 186
 //X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots.
184 187
 

+ 14
- 10
Marlin/Marlin_main.cpp View File

@@ -2569,13 +2569,7 @@ inline void gcode_G92() {
2569 2569
  */
2570 2570
 inline void gcode_M17() {
2571 2571
   LCD_MESSAGEPGM(MSG_NO_MOVE);
2572
-  enable_x();
2573
-  enable_y();
2574
-  enable_z();
2575
-  enable_e0();
2576
-  enable_e1();
2577
-  enable_e2();
2578
-  enable_e3();
2572
+  enable_all_steppers();
2579 2573
 }
2580 2574
 
2581 2575
 #ifdef SDSUPPORT
@@ -5695,7 +5689,17 @@ void handle_status_leds(void) {
5695 5689
 }
5696 5690
 #endif
5697 5691
 
5698
-void disable_all_axes() {
5692
+void enable_all_steppers() {
5693
+  enable_x();
5694
+  enable_y();
5695
+  enable_z();
5696
+  enable_e0();
5697
+  enable_e1();
5698
+  enable_e2();
5699
+  enable_e3();
5700
+}
5701
+
5702
+void disable_all_steppers() {
5699 5703
   disable_x();
5700 5704
   disable_y();
5701 5705
   disable_z();
@@ -5723,7 +5727,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
5723 5727
 
5724 5728
   if (stepper_inactive_time && ms > previous_millis_cmd + stepper_inactive_time
5725 5729
       && !ignore_stepper_queue && !blocks_queued())
5726
-    disable_all_axes();
5730
+    disable_all_steppers();
5727 5731
 
5728 5732
   #ifdef CHDK //Check if pin should be set to LOW after M240 set it to HIGH
5729 5733
     if (chdkActive && ms > chdkHigh + CHDK_DELAY) {
@@ -5811,7 +5815,7 @@ void kill()
5811 5815
   cli(); // Stop interrupts
5812 5816
   disable_heater();
5813 5817
 
5814
-  disable_all_axes();
5818
+  disable_all_steppers();
5815 5819
 
5816 5820
   #if HAS_POWER_SWITCH
5817 5821
     pinMode(PS_ON_PIN, INPUT);

+ 3
- 3
Marlin/planner.cpp View File

@@ -614,7 +614,7 @@ float junction_deviation = 0.1;
614 614
         #if EXTRUDERS > 1
615 615
           case 1:
616 616
             enable_e1();
617
-            g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE*2;
617
+            g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE * 2;
618 618
             if (g_uc_extruder_last_move[0] == 0) disable_e0();
619 619
             #if EXTRUDERS > 2
620 620
               if (g_uc_extruder_last_move[2] == 0) disable_e2();
@@ -626,7 +626,7 @@ float junction_deviation = 0.1;
626 626
           #if EXTRUDERS > 2
627 627
             case 2:
628 628
               enable_e2();
629
-              g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE*2;
629
+              g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE * 2;
630 630
               if (g_uc_extruder_last_move[0] == 0) disable_e0();
631 631
               if (g_uc_extruder_last_move[1] == 0) disable_e1();
632 632
               #if EXTRUDERS > 3
@@ -636,7 +636,7 @@ float junction_deviation = 0.1;
636 636
             #if EXTRUDERS > 3
637 637
               case 3:
638 638
                 enable_e3();
639
-                g_uc_extruder_last_move[3] = BLOCK_BUFFER_SIZE*2;
639
+                g_uc_extruder_last_move[3] = BLOCK_BUFFER_SIZE * 2;
640 640
                 if (g_uc_extruder_last_move[0] == 0) disable_e0();
641 641
                 if (g_uc_extruder_last_move[1] == 0) disable_e1();
642 642
                 if (g_uc_extruder_last_move[2] == 0) disable_e2();

+ 1
- 7
Marlin/stepper.cpp View File

@@ -1127,13 +1127,7 @@ long st_get_position(uint8_t axis) {
1127 1127
 
1128 1128
 void finishAndDisableSteppers() {
1129 1129
   st_synchronize();
1130
-  disable_x();
1131
-  disable_y();
1132
-  disable_z();
1133
-  disable_e0();
1134
-  disable_e1();
1135
-  disable_e2();
1136
-  disable_e3();
1130
+  disable_all_steppers();
1137 1131
 }
1138 1132
 
1139 1133
 void quickStop() {

+ 1
- 7
Marlin/temperature.cpp View File

@@ -1051,13 +1051,7 @@ void setWatch() {
1051 1051
           thermal_runaway = true;
1052 1052
           for (;;) {
1053 1053
             disable_heater();
1054
-            disable_x();
1055
-            disable_y();
1056
-            disable_z();
1057
-            disable_e0();
1058
-            disable_e1();
1059
-            disable_e2();
1060
-            disable_e3();
1054
+            disable_all_steppers();
1061 1055
             manage_heater();
1062 1056
             lcd_update();
1063 1057
           }

Loading…
Cancel
Save