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
   #define disable_e3() /* nothing */
179
   #define disable_e3() /* nothing */
180
 #endif
180
 #endif
181
 
181
 
182
+void enable_all_steppers();
183
+void disable_all_steppers();
184
+
182
 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};
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
 //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.
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
  */
2569
  */
2570
 inline void gcode_M17() {
2570
 inline void gcode_M17() {
2571
   LCD_MESSAGEPGM(MSG_NO_MOVE);
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
 #ifdef SDSUPPORT
2575
 #ifdef SDSUPPORT
5695
 }
5689
 }
5696
 #endif
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
   disable_x();
5703
   disable_x();
5700
   disable_y();
5704
   disable_y();
5701
   disable_z();
5705
   disable_z();
5723
 
5727
 
5724
   if (stepper_inactive_time && ms > previous_millis_cmd + stepper_inactive_time
5728
   if (stepper_inactive_time && ms > previous_millis_cmd + stepper_inactive_time
5725
       && !ignore_stepper_queue && !blocks_queued())
5729
       && !ignore_stepper_queue && !blocks_queued())
5726
-    disable_all_axes();
5730
+    disable_all_steppers();
5727
 
5731
 
5728
   #ifdef CHDK //Check if pin should be set to LOW after M240 set it to HIGH
5732
   #ifdef CHDK //Check if pin should be set to LOW after M240 set it to HIGH
5729
     if (chdkActive && ms > chdkHigh + CHDK_DELAY) {
5733
     if (chdkActive && ms > chdkHigh + CHDK_DELAY) {
5811
   cli(); // Stop interrupts
5815
   cli(); // Stop interrupts
5812
   disable_heater();
5816
   disable_heater();
5813
 
5817
 
5814
-  disable_all_axes();
5818
+  disable_all_steppers();
5815
 
5819
 
5816
   #if HAS_POWER_SWITCH
5820
   #if HAS_POWER_SWITCH
5817
     pinMode(PS_ON_PIN, INPUT);
5821
     pinMode(PS_ON_PIN, INPUT);

+ 3
- 3
Marlin/planner.cpp View File

614
         #if EXTRUDERS > 1
614
         #if EXTRUDERS > 1
615
           case 1:
615
           case 1:
616
             enable_e1();
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
             if (g_uc_extruder_last_move[0] == 0) disable_e0();
618
             if (g_uc_extruder_last_move[0] == 0) disable_e0();
619
             #if EXTRUDERS > 2
619
             #if EXTRUDERS > 2
620
               if (g_uc_extruder_last_move[2] == 0) disable_e2();
620
               if (g_uc_extruder_last_move[2] == 0) disable_e2();
626
           #if EXTRUDERS > 2
626
           #if EXTRUDERS > 2
627
             case 2:
627
             case 2:
628
               enable_e2();
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
               if (g_uc_extruder_last_move[0] == 0) disable_e0();
630
               if (g_uc_extruder_last_move[0] == 0) disable_e0();
631
               if (g_uc_extruder_last_move[1] == 0) disable_e1();
631
               if (g_uc_extruder_last_move[1] == 0) disable_e1();
632
               #if EXTRUDERS > 3
632
               #if EXTRUDERS > 3
636
             #if EXTRUDERS > 3
636
             #if EXTRUDERS > 3
637
               case 3:
637
               case 3:
638
                 enable_e3();
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
                 if (g_uc_extruder_last_move[0] == 0) disable_e0();
640
                 if (g_uc_extruder_last_move[0] == 0) disable_e0();
641
                 if (g_uc_extruder_last_move[1] == 0) disable_e1();
641
                 if (g_uc_extruder_last_move[1] == 0) disable_e1();
642
                 if (g_uc_extruder_last_move[2] == 0) disable_e2();
642
                 if (g_uc_extruder_last_move[2] == 0) disable_e2();

+ 1
- 7
Marlin/stepper.cpp View File

1127
 
1127
 
1128
 void finishAndDisableSteppers() {
1128
 void finishAndDisableSteppers() {
1129
   st_synchronize();
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
 void quickStop() {
1133
 void quickStop() {

+ 1
- 7
Marlin/temperature.cpp View File

1051
           thermal_runaway = true;
1051
           thermal_runaway = true;
1052
           for (;;) {
1052
           for (;;) {
1053
             disable_heater();
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
             manage_heater();
1055
             manage_heater();
1062
             lcd_update();
1056
             lcd_update();
1063
           }
1057
           }

Loading…
Cancel
Save