Browse Source

Simplify stepper macros by renaming enable/disable macros

Scott Lahteine 7 years ago
parent
commit
68773f4486
4 changed files with 139 additions and 138 deletions
  1. 52
    52
      Marlin/Marlin.h
  2. 28
    28
      Marlin/Marlin_main.cpp
  3. 46
    46
      Marlin/planner.cpp
  4. 13
    12
      Marlin/stepper.cpp

+ 52
- 52
Marlin/Marlin.h View File

@@ -60,36 +60,36 @@ void manage_inactivity(bool ignore_stepper_queue = false);
60 60
 #endif
61 61
 
62 62
 #if HAS_X2_ENABLE
63
-  #define  enable_x() do{ X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); }while(0)
64
-  #define disable_x() do{ X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; }while(0)
63
+  #define  enable_X() do{ X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); }while(0)
64
+  #define disable_X() do{ X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; }while(0)
65 65
 #elif HAS_X_ENABLE
66
-  #define  enable_x() X_ENABLE_WRITE( X_ENABLE_ON)
67
-  #define disable_x() do{ X_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; }while(0)
66
+  #define  enable_X() X_ENABLE_WRITE( X_ENABLE_ON)
67
+  #define disable_X() do{ X_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; }while(0)
68 68
 #else
69
-  #define  enable_x() NOOP
70
-  #define disable_x() NOOP
69
+  #define  enable_X() NOOP
70
+  #define disable_X() NOOP
71 71
 #endif
72 72
 
73 73
 #if HAS_Y2_ENABLE
74
-  #define  enable_y() do{ Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }while(0)
75
-  #define disable_y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }while(0)
74
+  #define  enable_Y() do{ Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }while(0)
75
+  #define disable_Y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }while(0)
76 76
 #elif HAS_Y_ENABLE
77
-  #define  enable_y() Y_ENABLE_WRITE( Y_ENABLE_ON)
78
-  #define disable_y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }while(0)
77
+  #define  enable_Y() Y_ENABLE_WRITE( Y_ENABLE_ON)
78
+  #define disable_Y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }while(0)
79 79
 #else
80
-  #define  enable_y() NOOP
81
-  #define disable_y() NOOP
80
+  #define  enable_Y() NOOP
81
+  #define disable_Y() NOOP
82 82
 #endif
83 83
 
84 84
 #if HAS_Z2_ENABLE
85
-  #define  enable_z() do{ Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }while(0)
86
-  #define disable_z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }while(0)
85
+  #define  enable_Z() do{ Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }while(0)
86
+  #define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }while(0)
87 87
 #elif HAS_Z_ENABLE
88
-  #define  enable_z() Z_ENABLE_WRITE( Z_ENABLE_ON)
89
-  #define disable_z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }while(0)
88
+  #define  enable_Z() Z_ENABLE_WRITE( Z_ENABLE_ON)
89
+  #define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }while(0)
90 90
 #else
91
-  #define  enable_z() NOOP
92
-  #define disable_z() NOOP
91
+  #define  enable_Z() NOOP
92
+  #define disable_Z() NOOP
93 93
 #endif
94 94
 
95 95
 #if ENABLED(MIXING_EXTRUDER)
@@ -98,64 +98,64 @@ void manage_inactivity(bool ignore_stepper_queue = false);
98 98
    * Mixing steppers synchronize their enable (and direction) together
99 99
    */
100 100
   #if MIXING_STEPPERS > 3
101
-    #define  enable_e0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); }
102
-    #define disable_e0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); }
101
+    #define  enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); }
102
+    #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); }
103 103
   #elif MIXING_STEPPERS > 2
104
-    #define  enable_e0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); }
105
-    #define disable_e0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); }
104
+    #define  enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); }
105
+    #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); }
106 106
   #else
107
-    #define  enable_e0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); }
108
-    #define disable_e0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); }
107
+    #define  enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); }
108
+    #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); }
109 109
   #endif
110
-  #define  enable_e1() NOOP
111
-  #define disable_e1() NOOP
112
-  #define  enable_e2() NOOP
113
-  #define disable_e2() NOOP
114
-  #define  enable_e3() NOOP
115
-  #define disable_e3() NOOP
116
-  #define  enable_e4() NOOP
117
-  #define disable_e4() NOOP
110
+  #define  enable_E1() NOOP
111
+  #define disable_E1() NOOP
112
+  #define  enable_E2() NOOP
113
+  #define disable_E2() NOOP
114
+  #define  enable_E3() NOOP
115
+  #define disable_E3() NOOP
116
+  #define  enable_E4() NOOP
117
+  #define disable_E4() NOOP
118 118
 
119 119
 #else // !MIXING_EXTRUDER
120 120
 
121 121
   #if HAS_E0_ENABLE
122
-    #define  enable_e0() E0_ENABLE_WRITE( E_ENABLE_ON)
123
-    #define disable_e0() E0_ENABLE_WRITE(!E_ENABLE_ON)
122
+    #define  enable_E0() E0_ENABLE_WRITE( E_ENABLE_ON)
123
+    #define disable_E0() E0_ENABLE_WRITE(!E_ENABLE_ON)
124 124
   #else
125
-    #define  enable_e0() NOOP
126
-    #define disable_e0() NOOP
125
+    #define  enable_E0() NOOP
126
+    #define disable_E0() NOOP
127 127
   #endif
128 128
 
129 129
   #if E_STEPPERS > 1 && HAS_E1_ENABLE
130
-    #define  enable_e1() E1_ENABLE_WRITE( E_ENABLE_ON)
131
-    #define disable_e1() E1_ENABLE_WRITE(!E_ENABLE_ON)
130
+    #define  enable_E1() E1_ENABLE_WRITE( E_ENABLE_ON)
131
+    #define disable_E1() E1_ENABLE_WRITE(!E_ENABLE_ON)
132 132
   #else
133
-    #define  enable_e1() NOOP
134
-    #define disable_e1() NOOP
133
+    #define  enable_E1() NOOP
134
+    #define disable_E1() NOOP
135 135
   #endif
136 136
 
137 137
   #if E_STEPPERS > 2 && HAS_E2_ENABLE
138
-    #define  enable_e2() E2_ENABLE_WRITE( E_ENABLE_ON)
139
-    #define disable_e2() E2_ENABLE_WRITE(!E_ENABLE_ON)
138
+    #define  enable_E2() E2_ENABLE_WRITE( E_ENABLE_ON)
139
+    #define disable_E2() E2_ENABLE_WRITE(!E_ENABLE_ON)
140 140
   #else
141
-    #define  enable_e2() NOOP
142
-    #define disable_e2() NOOP
141
+    #define  enable_E2() NOOP
142
+    #define disable_E2() NOOP
143 143
   #endif
144 144
 
145 145
   #if E_STEPPERS > 3 && HAS_E3_ENABLE
146
-    #define  enable_e3() E3_ENABLE_WRITE( E_ENABLE_ON)
147
-    #define disable_e3() E3_ENABLE_WRITE(!E_ENABLE_ON)
146
+    #define  enable_E3() E3_ENABLE_WRITE( E_ENABLE_ON)
147
+    #define disable_E3() E3_ENABLE_WRITE(!E_ENABLE_ON)
148 148
   #else
149
-    #define  enable_e3() NOOP
150
-    #define disable_e3() NOOP
149
+    #define  enable_E3() NOOP
150
+    #define disable_E3() NOOP
151 151
   #endif
152 152
 
153 153
   #if E_STEPPERS > 4 && HAS_E4_ENABLE
154
-    #define  enable_e4() E4_ENABLE_WRITE( E_ENABLE_ON)
155
-    #define disable_e4() E4_ENABLE_WRITE(!E_ENABLE_ON)
154
+    #define  enable_E4() E4_ENABLE_WRITE( E_ENABLE_ON)
155
+    #define disable_E4() E4_ENABLE_WRITE(!E_ENABLE_ON)
156 156
   #else
157
-    #define  enable_e4() NOOP
158
-    #define disable_e4() NOOP
157
+    #define  enable_E4() NOOP
158
+    #define disable_E4() NOOP
159 159
   #endif
160 160
 
161 161
 #endif // !MIXING_EXTRUDER

+ 28
- 28
Marlin/Marlin_main.cpp View File

@@ -6489,9 +6489,9 @@ inline void gcode_M18_M84() {
6489 6489
     }
6490 6490
     else {
6491 6491
       stepper.synchronize();
6492
-      if (code_seen('X')) disable_x();
6493
-      if (code_seen('Y')) disable_y();
6494
-      if (code_seen('Z')) disable_z();
6492
+      if (code_seen('X')) disable_X();
6493
+      if (code_seen('Y')) disable_Y();
6494
+      if (code_seen('Z')) disable_Z();
6495 6495
       #if ((E0_ENABLE_PIN != X_ENABLE_PIN) && (E1_ENABLE_PIN != Y_ENABLE_PIN)) // Only enable on boards that have seperate ENABLE_PINS
6496 6496
         if (code_seen('E')) disable_e_steppers();
6497 6497
       #endif
@@ -10888,28 +10888,28 @@ void calculate_volumetric_multipliers() {
10888 10888
 }
10889 10889
 
10890 10890
 void enable_all_steppers() {
10891
-  enable_x();
10892
-  enable_y();
10893
-  enable_z();
10894
-  enable_e0();
10895
-  enable_e1();
10896
-  enable_e2();
10897
-  enable_e3();
10898
-  enable_e4();
10891
+  enable_X();
10892
+  enable_Y();
10893
+  enable_Z();
10894
+  enable_E0();
10895
+  enable_E1();
10896
+  enable_E2();
10897
+  enable_E3();
10898
+  enable_E4();
10899 10899
 }
10900 10900
 
10901 10901
 void disable_e_steppers() {
10902
-  disable_e0();
10903
-  disable_e1();
10904
-  disable_e2();
10905
-  disable_e3();
10906
-  disable_e4();
10902
+  disable_E0();
10903
+  disable_E1();
10904
+  disable_E2();
10905
+  disable_E3();
10906
+  disable_E4();
10907 10907
 }
10908 10908
 
10909 10909
 void disable_all_steppers() {
10910
-  disable_x();
10911
-  disable_y();
10912
-  disable_z();
10910
+  disable_X();
10911
+  disable_Y();
10912
+  disable_Z();
10913 10913
   disable_e_steppers();
10914 10914
 }
10915 10915
 
@@ -11011,13 +11011,13 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
11011 11011
   if (M600_TEST && stepper_inactive_time && ELAPSED(ms, previous_cmd_ms + stepper_inactive_time)
11012 11012
       && !ignore_stepper_queue && !planner.blocks_queued()) {
11013 11013
     #if ENABLED(DISABLE_INACTIVE_X)
11014
-      disable_x();
11014
+      disable_X();
11015 11015
     #endif
11016 11016
     #if ENABLED(DISABLE_INACTIVE_Y)
11017
-      disable_y();
11017
+      disable_Y();
11018 11018
     #endif
11019 11019
     #if ENABLED(DISABLE_INACTIVE_Z)
11020
-      disable_z();
11020
+      disable_Z();
11021 11021
     #endif
11022 11022
     #if ENABLED(DISABLE_INACTIVE_E)
11023 11023
       disable_e_steppers();
@@ -11080,32 +11080,32 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
11080 11080
       bool oldstatus;
11081 11081
       #if ENABLED(SWITCHING_EXTRUDER)
11082 11082
         oldstatus = E0_ENABLE_READ;
11083
-        enable_e0();
11083
+        enable_E0();
11084 11084
       #else // !SWITCHING_EXTRUDER
11085 11085
         switch (active_extruder) {
11086 11086
           case 0:
11087 11087
             oldstatus = E0_ENABLE_READ;
11088
-            enable_e0();
11088
+            enable_E0();
11089 11089
             break;
11090 11090
           #if E_STEPPERS > 1
11091 11091
             case 1:
11092 11092
               oldstatus = E1_ENABLE_READ;
11093
-              enable_e1();
11093
+              enable_E1();
11094 11094
               break;
11095 11095
             #if E_STEPPERS > 2
11096 11096
               case 2:
11097 11097
                 oldstatus = E2_ENABLE_READ;
11098
-                enable_e2();
11098
+                enable_E2();
11099 11099
                 break;
11100 11100
               #if E_STEPPERS > 3
11101 11101
                 case 3:
11102 11102
                   oldstatus = E3_ENABLE_READ;
11103
-                  enable_e3();
11103
+                  enable_E3();
11104 11104
                   break;
11105 11105
                 #if E_STEPPERS > 4
11106 11106
                   case 4:
11107 11107
                     oldstatus = E4_ENABLE_READ;
11108
-                    enable_e4();
11108
+                    enable_E4();
11109 11109
                     break;
11110 11110
                 #endif // E_STEPPERS > 4
11111 11111
               #endif // E_STEPPERS > 3

+ 46
- 46
Marlin/planner.cpp View File

@@ -441,13 +441,13 @@ void Planner::check_axes_activity() {
441 441
     }
442 442
   }
443 443
   #if ENABLED(DISABLE_X)
444
-    if (!axis_active[X_AXIS]) disable_x();
444
+    if (!axis_active[X_AXIS]) disable_X();
445 445
   #endif
446 446
   #if ENABLED(DISABLE_Y)
447
-    if (!axis_active[Y_AXIS]) disable_y();
447
+    if (!axis_active[Y_AXIS]) disable_Y();
448 448
   #endif
449 449
   #if ENABLED(DISABLE_Z)
450
-    if (!axis_active[Z_AXIS]) disable_z();
450
+    if (!axis_active[Z_AXIS]) disable_Z();
451 451
   #endif
452 452
   #if ENABLED(DISABLE_E)
453 453
     if (!axis_active[E_AXIS]) disable_e_steppers();
@@ -832,29 +832,29 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
832 832
   //enable active axes
833 833
   #if CORE_IS_XY
834 834
     if (block->steps[A_AXIS] || block->steps[B_AXIS]) {
835
-      enable_x();
836
-      enable_y();
835
+      enable_X();
836
+      enable_Y();
837 837
     }
838 838
     #if DISABLED(Z_LATE_ENABLE)
839
-      if (block->steps[Z_AXIS]) enable_z();
839
+      if (block->steps[Z_AXIS]) enable_Z();
840 840
     #endif
841 841
   #elif CORE_IS_XZ
842 842
     if (block->steps[A_AXIS] || block->steps[C_AXIS]) {
843
-      enable_x();
844
-      enable_z();
843
+      enable_X();
844
+      enable_Z();
845 845
     }
846
-    if (block->steps[Y_AXIS]) enable_y();
846
+    if (block->steps[Y_AXIS]) enable_Y();
847 847
   #elif CORE_IS_YZ
848 848
     if (block->steps[B_AXIS] || block->steps[C_AXIS]) {
849
-      enable_y();
850
-      enable_z();
849
+      enable_Y();
850
+      enable_Z();
851 851
     }
852
-    if (block->steps[X_AXIS]) enable_x();
852
+    if (block->steps[X_AXIS]) enable_X();
853 853
   #else
854
-    if (block->steps[X_AXIS]) enable_x();
855
-    if (block->steps[Y_AXIS]) enable_y();
854
+    if (block->steps[X_AXIS]) enable_X();
855
+    if (block->steps[Y_AXIS]) enable_Y();
856 856
     #if DISABLED(Z_LATE_ENABLE)
857
-      if (block->steps[Z_AXIS]) enable_z();
857
+      if (block->steps[Z_AXIS]) enable_Z();
858 858
     #endif
859 859
   #endif
860 860
 
@@ -868,22 +868,22 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
868 868
 
869 869
       switch(extruder) {
870 870
         case 0:
871
-          enable_e0();
871
+          enable_E0();
872 872
           #if ENABLED(DUAL_X_CARRIAGE)
873 873
             if (extruder_duplication_enabled) {
874
-              enable_e1();
874
+              enable_E1();
875 875
               g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
876 876
             }
877 877
           #endif
878 878
           g_uc_extruder_last_move[0] = (BLOCK_BUFFER_SIZE) * 2;
879 879
           #if EXTRUDERS > 1
880
-            if (g_uc_extruder_last_move[1] == 0) disable_e1();
880
+            if (g_uc_extruder_last_move[1] == 0) disable_E1();
881 881
             #if EXTRUDERS > 2
882
-              if (g_uc_extruder_last_move[2] == 0) disable_e2();
882
+              if (g_uc_extruder_last_move[2] == 0) disable_E2();
883 883
               #if EXTRUDERS > 3
884
-                if (g_uc_extruder_last_move[3] == 0) disable_e3();
884
+                if (g_uc_extruder_last_move[3] == 0) disable_E3();
885 885
                 #if EXTRUDERS > 4
886
-                  if (g_uc_extruder_last_move[4] == 0) disable_e4();
886
+                  if (g_uc_extruder_last_move[4] == 0) disable_E4();
887 887
                 #endif // EXTRUDERS > 4
888 888
               #endif // EXTRUDERS > 3
889 889
             #endif // EXTRUDERS > 2
@@ -891,51 +891,51 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
891 891
         break;
892 892
         #if EXTRUDERS > 1
893 893
           case 1:
894
-            enable_e1();
894
+            enable_E1();
895 895
             g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
896
-            if (g_uc_extruder_last_move[0] == 0) disable_e0();
896
+            if (g_uc_extruder_last_move[0] == 0) disable_E0();
897 897
             #if EXTRUDERS > 2
898
-              if (g_uc_extruder_last_move[2] == 0) disable_e2();
898
+              if (g_uc_extruder_last_move[2] == 0) disable_E2();
899 899
               #if EXTRUDERS > 3
900
-                if (g_uc_extruder_last_move[3] == 0) disable_e3();
900
+                if (g_uc_extruder_last_move[3] == 0) disable_E3();
901 901
                 #if EXTRUDERS > 4
902
-                  if (g_uc_extruder_last_move[4] == 0) disable_e4();
902
+                  if (g_uc_extruder_last_move[4] == 0) disable_E4();
903 903
                 #endif // EXTRUDERS > 4
904 904
               #endif // EXTRUDERS > 3
905 905
             #endif // EXTRUDERS > 2
906 906
           break;
907 907
           #if EXTRUDERS > 2
908 908
             case 2:
909
-              enable_e2();
909
+              enable_E2();
910 910
               g_uc_extruder_last_move[2] = (BLOCK_BUFFER_SIZE) * 2;
911
-              if (g_uc_extruder_last_move[0] == 0) disable_e0();
912
-              if (g_uc_extruder_last_move[1] == 0) disable_e1();
911
+              if (g_uc_extruder_last_move[0] == 0) disable_E0();
912
+              if (g_uc_extruder_last_move[1] == 0) disable_E1();
913 913
               #if EXTRUDERS > 3
914
-                if (g_uc_extruder_last_move[3] == 0) disable_e3();
914
+                if (g_uc_extruder_last_move[3] == 0) disable_E3();
915 915
                 #if EXTRUDERS > 4
916
-                  if (g_uc_extruder_last_move[4] == 0) disable_e4();
916
+                  if (g_uc_extruder_last_move[4] == 0) disable_E4();
917 917
                 #endif
918 918
               #endif
919 919
             break;
920 920
             #if EXTRUDERS > 3
921 921
               case 3:
922
-                enable_e3();
922
+                enable_E3();
923 923
                 g_uc_extruder_last_move[3] = (BLOCK_BUFFER_SIZE) * 2;
924
-                if (g_uc_extruder_last_move[0] == 0) disable_e0();
925
-                if (g_uc_extruder_last_move[1] == 0) disable_e1();
926
-                if (g_uc_extruder_last_move[2] == 0) disable_e2();
924
+                if (g_uc_extruder_last_move[0] == 0) disable_E0();
925
+                if (g_uc_extruder_last_move[1] == 0) disable_E1();
926
+                if (g_uc_extruder_last_move[2] == 0) disable_E2();
927 927
                 #if EXTRUDERS > 4
928
-                  if (g_uc_extruder_last_move[4] == 0) disable_e4();
928
+                  if (g_uc_extruder_last_move[4] == 0) disable_E4();
929 929
                 #endif
930 930
               break;
931 931
               #if EXTRUDERS > 4
932 932
                 case 4:
933
-                  enable_e4();
933
+                  enable_E4();
934 934
                   g_uc_extruder_last_move[4] = (BLOCK_BUFFER_SIZE) * 2;
935
-                  if (g_uc_extruder_last_move[0] == 0) disable_e0();
936
-                  if (g_uc_extruder_last_move[1] == 0) disable_e1();
937
-                  if (g_uc_extruder_last_move[2] == 0) disable_e2();
938
-                  if (g_uc_extruder_last_move[3] == 0) disable_e3();
935
+                  if (g_uc_extruder_last_move[0] == 0) disable_E0();
936
+                  if (g_uc_extruder_last_move[1] == 0) disable_E1();
937
+                  if (g_uc_extruder_last_move[2] == 0) disable_E2();
938
+                  if (g_uc_extruder_last_move[3] == 0) disable_E3();
939 939
                 break;
940 940
               #endif // EXTRUDERS > 4
941 941
             #endif // EXTRUDERS > 3
@@ -943,11 +943,11 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
943 943
         #endif // EXTRUDERS > 1
944 944
       }
945 945
     #else
946
-      enable_e0();
947
-      enable_e1();
948
-      enable_e2();
949
-      enable_e3();
950
-      enable_e4();
946
+      enable_E0();
947
+      enable_E1();
948
+      enable_E2();
949
+      enable_E3();
950
+      enable_E4();
951 951
     #endif
952 952
   }
953 953
 

+ 13
- 12
Marlin/stepper.cpp View File

@@ -428,7 +428,7 @@ void Stepper::isr() {
428 428
 
429 429
       #if ENABLED(Z_LATE_ENABLE)
430 430
         if (current_block->steps[Z_AXIS] > 0) {
431
-          enable_z();
431
+          enable_Z();
432 432
           _NEXT_ISR(2000); // Run at slow speed - 1 KHz
433 433
           _ENABLE_ISRs(); // re-enable ISRs
434 434
           return;
@@ -986,14 +986,14 @@ void Stepper::init() {
986 986
 
987 987
   #define _STEP_INIT(AXIS) AXIS ##_STEP_INIT
988 988
   #define _WRITE_STEP(AXIS, HIGHLOW) AXIS ##_STEP_WRITE(HIGHLOW)
989
-  #define _DISABLE(axis) disable_## axis()
989
+  #define _DISABLE(AXIS) disable_## AXIS()
990 990
 
991
-  #define AXIS_INIT(axis, AXIS, PIN) \
991
+  #define AXIS_INIT(AXIS, PIN) \
992 992
     _STEP_INIT(AXIS); \
993 993
     _WRITE_STEP(AXIS, _INVERT_STEP_PIN(PIN)); \
994
-    _DISABLE(axis)
994
+    _DISABLE(AXIS)
995 995
 
996
-  #define E_AXIS_INIT(NUM) AXIS_INIT(e## NUM, E## NUM, E)
996
+  #define E_AXIS_INIT(NUM) AXIS_INIT(E## NUM, E)
997 997
 
998 998
   // Init Step Pins
999 999
   #if HAS_X_STEP
@@ -1001,7 +1001,7 @@ void Stepper::init() {
1001 1001
       X2_STEP_INIT;
1002 1002
       X2_STEP_WRITE(INVERT_X_STEP_PIN);
1003 1003
     #endif
1004
-    AXIS_INIT(x, X, X);
1004
+    AXIS_INIT(X, X);
1005 1005
   #endif
1006 1006
 
1007 1007
   #if HAS_Y_STEP
@@ -1009,7 +1009,7 @@ void Stepper::init() {
1009 1009
       Y2_STEP_INIT;
1010 1010
       Y2_STEP_WRITE(INVERT_Y_STEP_PIN);
1011 1011
     #endif
1012
-    AXIS_INIT(y, Y, Y);
1012
+    AXIS_INIT(Y, Y);
1013 1013
   #endif
1014 1014
 
1015 1015
   #if HAS_Z_STEP
@@ -1017,7 +1017,7 @@ void Stepper::init() {
1017 1017
       Z2_STEP_INIT;
1018 1018
       Z2_STEP_WRITE(INVERT_Z_STEP_PIN);
1019 1019
     #endif
1020
-    AXIS_INIT(z, Z, Z);
1020
+    AXIS_INIT(Z, Z);
1021 1021
   #endif
1022 1022
 
1023 1023
   #if HAS_E0_STEP
@@ -1237,7 +1237,7 @@ void Stepper::report_positions() {
1237 1237
 
1238 1238
   #define CYCLES_EATEN_BY_BABYSTEP 60
1239 1239
 
1240
-  #define _ENABLE(axis) enable_## axis()
1240
+  #define _ENABLE(AXIS) enable_## AXIS()
1241 1241
   #define _READ_DIR(AXIS) AXIS ##_DIR_READ
1242 1242
   #define _INVERT_DIR(AXIS) INVERT_## AXIS ##_DIR
1243 1243
   #define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true)
@@ -1298,9 +1298,10 @@ void Stepper::report_positions() {
1298 1298
 
1299 1299
           bool z_direction = direction ^ BABYSTEP_INVERT_Z;
1300 1300
 
1301
-          enable_x();
1302
-          enable_y();
1303
-          enable_z();
1301
+          enable_X();
1302
+          enable_Y();
1303
+          enable_Z();
1304
+
1304 1305
           uint8_t old_x_dir_pin = X_DIR_READ,
1305 1306
                   old_y_dir_pin = Y_DIR_READ,
1306 1307
                   old_z_dir_pin = Z_DIR_READ;

Loading…
Cancel
Save