Browse Source

Gradual step towards EXTRUDERS 0 support

Scott Lahteine 5 years ago
parent
commit
2f1e1dcb42

+ 18
- 16
Marlin/src/feature/controllerfan.cpp View File

@@ -53,22 +53,24 @@ void controllerfan_update() {
53 53
         #if HAS_Z3_ENABLE
54 54
           || Z3_ENABLE_READ == Z_ENABLE_ON
55 55
         #endif
56
-        || E0_ENABLE_READ == E_ENABLE_ON
57
-        #if E_STEPPERS > 1
58
-          || E1_ENABLE_READ == E_ENABLE_ON
59
-          #if E_STEPPERS > 2
60
-            || E2_ENABLE_READ == E_ENABLE_ON
61
-            #if E_STEPPERS > 3
62
-              || E3_ENABLE_READ == E_ENABLE_ON
63
-              #if E_STEPPERS > 4
64
-                || E4_ENABLE_READ == E_ENABLE_ON
65
-                #if E_STEPPERS > 5
66
-                  || E5_ENABLE_READ == E_ENABLE_ON
67
-                #endif
68
-              #endif
69
-            #endif
70
-          #endif
71
-        #endif
56
+        #if E_STEPPERS
57
+          || E0_ENABLE_READ == E_ENABLE_ON
58
+          #if E_STEPPERS > 1
59
+            || E1_ENABLE_READ == E_ENABLE_ON
60
+            #if E_STEPPERS > 2
61
+              || E2_ENABLE_READ == E_ENABLE_ON
62
+              #if E_STEPPERS > 3
63
+                || E3_ENABLE_READ == E_ENABLE_ON
64
+                #if E_STEPPERS > 4
65
+                  || E4_ENABLE_READ == E_ENABLE_ON
66
+                  #if E_STEPPERS > 5
67
+                    || E5_ENABLE_READ == E_ENABLE_ON
68
+                  #endif // E_STEPPERS > 5
69
+                #endif // E_STEPPERS > 4
70
+              #endif // E_STEPPERS > 3
71
+            #endif // E_STEPPERS > 2
72
+          #endif // E_STEPPERS > 1
73
+        #endif // E_STEPPERS
72 74
     ) {
73 75
       lastMotorOn = ms; //... set time to NOW so the fan will turn on
74 76
     }

+ 18
- 16
Marlin/src/feature/power.cpp View File

@@ -64,22 +64,24 @@ bool Power::is_power_needed() {
64 64
       #if HAS_Z2_ENABLE
65 65
         || Z2_ENABLE_READ == Z_ENABLE_ON
66 66
       #endif
67
-      || E0_ENABLE_READ == E_ENABLE_ON
68
-      #if E_STEPPERS > 1
69
-        || E1_ENABLE_READ == E_ENABLE_ON
70
-        #if E_STEPPERS > 2
71
-          || E2_ENABLE_READ == E_ENABLE_ON
72
-          #if E_STEPPERS > 3
73
-            || E3_ENABLE_READ == E_ENABLE_ON
74
-            #if E_STEPPERS > 4
75
-              || E4_ENABLE_READ == E_ENABLE_ON
76
-              #if E_STEPPERS > 5
77
-                || E5_ENABLE_READ == E_ENABLE_ON
78
-              #endif
79
-            #endif
80
-          #endif
81
-        #endif
82
-      #endif
67
+      #if E_STEPPERS
68
+        || E0_ENABLE_READ == E_ENABLE_ON
69
+        #if E_STEPPERS > 1
70
+          || E1_ENABLE_READ == E_ENABLE_ON
71
+          #if E_STEPPERS > 2
72
+            || E2_ENABLE_READ == E_ENABLE_ON
73
+            #if E_STEPPERS > 3
74
+              || E3_ENABLE_READ == E_ENABLE_ON
75
+              #if E_STEPPERS > 4
76
+                || E4_ENABLE_READ == E_ENABLE_ON
77
+                #if E_STEPPERS > 5
78
+                  || E5_ENABLE_READ == E_ENABLE_ON
79
+                #endif // E_STEPPERS > 5
80
+              #endif // E_STEPPERS > 4
81
+            #endif // E_STEPPERS > 3
82
+          #endif // E_STEPPERS > 2
83
+        #endif // E_STEPPERS > 1
84
+      #endif // E_STEPPERS
83 85
   ) return true;
84 86
 
85 87
   HOTEND_LOOP() if (thermalManager.degTargetHotend(e) > 0) return true;

+ 25
- 23
Marlin/src/gcode/feature/trinamic/M911-M914.cpp View File

@@ -232,28 +232,30 @@
232 232
           #endif
233 233
           break;
234 234
         case E_AXIS: {
235
-          const int8_t target_extruder = get_target_extruder_from_command();
236
-          if (target_extruder < 0) return;
237
-          switch (target_extruder) {
238
-            #if AXIS_HAS_STEALTHCHOP(E0)
239
-              case 0: TMC_SET_PWMTHRS_E(0); break;
240
-            #endif
241
-            #if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1)
242
-              case 1: TMC_SET_PWMTHRS_E(1); break;
243
-            #endif
244
-            #if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2)
245
-              case 2: TMC_SET_PWMTHRS_E(2); break;
246
-            #endif
247
-            #if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3)
248
-              case 3: TMC_SET_PWMTHRS_E(3); break;
249
-            #endif
250
-            #if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4)
251
-              case 4: TMC_SET_PWMTHRS_E(4); break;
252
-            #endif
253
-            #if E_STEPPERS > 5 && AXIS_HAS_STEALTHCHOP(E5)
254
-              case 5: TMC_SET_PWMTHRS_E(5); break;
255
-            #endif
256
-          }
235
+          #if E_STEPPERS
236
+            const int8_t target_extruder = get_target_extruder_from_command();
237
+            if (target_extruder < 0) return;
238
+            switch (target_extruder) {
239
+              #if AXIS_HAS_STEALTHCHOP(E0)
240
+                case 0: TMC_SET_PWMTHRS_E(0); break;
241
+              #endif
242
+              #if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1)
243
+                case 1: TMC_SET_PWMTHRS_E(1); break;
244
+              #endif
245
+              #if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2)
246
+                case 2: TMC_SET_PWMTHRS_E(2); break;
247
+              #endif
248
+              #if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3)
249
+                case 3: TMC_SET_PWMTHRS_E(3); break;
250
+              #endif
251
+              #if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4)
252
+                case 4: TMC_SET_PWMTHRS_E(4); break;
253
+              #endif
254
+              #if E_STEPPERS > 5 && AXIS_HAS_STEALTHCHOP(E5)
255
+                case 5: TMC_SET_PWMTHRS_E(5); break;
256
+              #endif
257
+            }
258
+          #endif // E_STEPPERS
257 259
         } break;
258 260
       }
259 261
     }
@@ -280,7 +282,7 @@
280 282
       #if AXIS_HAS_STEALTHCHOP(Z3)
281 283
         TMC_SAY_PWMTHRS(Z,Z3);
282 284
       #endif
283
-      #if AXIS_HAS_STEALTHCHOP(E0)
285
+      #if E_STEPPERS && AXIS_HAS_STEALTHCHOP(E0)
284 286
         TMC_SAY_PWMTHRS_E(0);
285 287
       #endif
286 288
       #if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1)

+ 10
- 0
Marlin/src/inc/Conditionals_LCD.h View File

@@ -370,6 +370,16 @@
370 370
  *
371 371
  */
372 372
 
373
+#if EXTRUDERS == 0
374
+  #undef DISTINCT_E_FACTORS
375
+  #undef SINGLENOZZLE
376
+  #undef SWITCHING_EXTRUDER
377
+  #undef SWITCHING_NOZZLE
378
+  #undef MIXING_EXTRUDER
379
+  #undef MK2_MULTIPLEXER
380
+  #undef PRUSA_MMU2
381
+#endif
382
+
373 383
 #if ENABLED(SWITCHING_EXTRUDER)   // One stepper for every two EXTRUDERS
374 384
   #if EXTRUDERS > 4
375 385
     #define E_STEPPERS    3

+ 10
- 0
Marlin/src/inc/Conditionals_post.h View File

@@ -43,6 +43,16 @@
43 43
   #define NOT_A_PIN 0 // For PINS_DEBUGGING
44 44
 #endif
45 45
 
46
+#if EXTRUDERS == 0
47
+  #define NO_VOLUMETRICS
48
+  #undef FWRETRACT
49
+  #undef LIN_ADVANCE
50
+  #undef ADVANCED_PAUSE_FEATURE
51
+  #undef DISABLE_INACTIVE_EXTRUDER
52
+  #undef EXTRUDER_RUNOUT_PREVENT
53
+  #undef FILAMENT_LOAD_UNLOAD_GCODES
54
+#endif
55
+
46 56
 #define HAS_CLASSIC_JERK (IS_KINEMATIC || DISABLED(JUNCTION_DEVIATION))
47 57
 
48 58
 /**

+ 3
- 3
Marlin/src/lcd/menu/menu_advanced.cpp View File

@@ -475,7 +475,7 @@ DEFINE_PIDTEMP_FUNCS(0);
475 475
           #endif // E_STEPPERS > 4
476 476
         #endif // E_STEPPERS > 3
477 477
       #endif // E_STEPPERS > 2
478
-    #else
478
+    #elif E_STEPPERS
479 479
       MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.settings.max_feedrate_mm_s[E_AXIS], 1, 999);
480 480
     #endif
481 481
 
@@ -525,7 +525,7 @@ DEFINE_PIDTEMP_FUNCS(0);
525 525
           #endif // E_STEPPERS > 4
526 526
         #endif // E_STEPPERS > 3
527 527
       #endif // E_STEPPERS > 2
528
-    #else
528
+    #elif E_STEPPERS
529 529
       MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_acceleration_rates);
530 530
     #endif
531 531
 
@@ -588,7 +588,7 @@ DEFINE_PIDTEMP_FUNCS(0);
588 588
           #endif // E_STEPPERS > 4
589 589
         #endif // E_STEPPERS > 3
590 590
       #endif // E_STEPPERS > 2
591
-    #else
591
+    #elif E_STEPPERS
592 592
       MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_positioning);
593 593
     #endif
594 594
 

+ 28
- 26
Marlin/src/lcd/menu/menu_filament.cpp View File

@@ -104,32 +104,34 @@ void _menu_temp_filament_op(const AdvancedPauseMode mode, const int8_t extruder)
104 104
   MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PREHEAT_CUSTOM, &thermalManager.target_temperature[_change_filament_temp_extruder], EXTRUDE_MINTEMP, max_temp - 15, _lcd_change_filament_temp_custom_cb);
105 105
   END_MENU();
106 106
 }
107
-void menu_temp_e0_filament_change()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 0); }
108
-void menu_temp_e0_filament_load()    { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 0); }
109
-void menu_temp_e0_filament_unload()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 0); }
110
-#if E_STEPPERS > 1
111
-  void menu_temp_e1_filament_change()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 1); }
112
-  void menu_temp_e1_filament_load()    { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 1); }
113
-  void menu_temp_e1_filament_unload()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 1); }
114
-  #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS)
115
-    void menu_unload_filament_all_temp() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, -1); }
116
-  #endif
117
-  #if E_STEPPERS > 2
118
-    void menu_temp_e2_filament_change()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 2); }
119
-    void menu_temp_e2_filament_load()    { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 2); }
120
-    void menu_temp_e2_filament_unload()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 2); }
121
-    #if E_STEPPERS > 3
122
-      void menu_temp_e3_filament_change()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 3); }
123
-      void menu_temp_e3_filament_load()    { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 3); }
124
-      void menu_temp_e3_filament_unload()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 3); }
125
-      #if E_STEPPERS > 4
126
-        void menu_temp_e4_filament_change()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 4); }
127
-        void menu_temp_e4_filament_load()    { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 4); }
128
-        void menu_temp_e4_filament_unload()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 4); }
129
-      #endif // E_STEPPERS > 4
130
-    #endif // E_STEPPERS > 3
131
-  #endif // E_STEPPERS > 2
132
-#endif // E_STEPPERS > 1
107
+#if E_STEPPERS
108
+  void menu_temp_e0_filament_change()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 0); }
109
+  void menu_temp_e0_filament_load()    { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 0); }
110
+  void menu_temp_e0_filament_unload()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 0); }
111
+  #if E_STEPPERS > 1
112
+    void menu_temp_e1_filament_change()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 1); }
113
+    void menu_temp_e1_filament_load()    { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 1); }
114
+    void menu_temp_e1_filament_unload()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 1); }
115
+    #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS)
116
+      void menu_unload_filament_all_temp() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, -1); }
117
+    #endif
118
+    #if E_STEPPERS > 2
119
+      void menu_temp_e2_filament_change()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 2); }
120
+      void menu_temp_e2_filament_load()    { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 2); }
121
+      void menu_temp_e2_filament_unload()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 2); }
122
+      #if E_STEPPERS > 3
123
+        void menu_temp_e3_filament_change()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 3); }
124
+        void menu_temp_e3_filament_load()    { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 3); }
125
+        void menu_temp_e3_filament_unload()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 3); }
126
+        #if E_STEPPERS > 4
127
+          void menu_temp_e4_filament_change()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 4); }
128
+          void menu_temp_e4_filament_load()    { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 4); }
129
+          void menu_temp_e4_filament_unload()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 4); }
130
+        #endif // E_STEPPERS > 4
131
+      #endif // E_STEPPERS > 3
132
+    #endif // E_STEPPERS > 2
133
+  #endif // E_STEPPERS > 1
134
+#endif // E_STEPPERS
133 135
 
134 136
 /**
135 137
  *

+ 21
- 19
Marlin/src/lcd/menu/menu_tune.cpp View File

@@ -43,23 +43,25 @@
43 43
 #endif
44 44
 
45 45
 // Refresh the E factor after changing flow
46
-void _lcd_refresh_e_factor_0() { planner.refresh_e_factor(0); }
47
-#if EXTRUDERS > 1
48
-  void _lcd_refresh_e_factor() { planner.refresh_e_factor(active_extruder); }
49
-  void _lcd_refresh_e_factor_1() { planner.refresh_e_factor(1); }
50
-  #if EXTRUDERS > 2
51
-    void _lcd_refresh_e_factor_2() { planner.refresh_e_factor(2); }
52
-    #if EXTRUDERS > 3
53
-      void _lcd_refresh_e_factor_3() { planner.refresh_e_factor(3); }
54
-      #if EXTRUDERS > 4
55
-        void _lcd_refresh_e_factor_4() { planner.refresh_e_factor(4); }
56
-        #if EXTRUDERS > 5
57
-          void _lcd_refresh_e_factor_5() { planner.refresh_e_factor(5); }
58
-        #endif // EXTRUDERS > 5
59
-      #endif // EXTRUDERS > 4
60
-    #endif // EXTRUDERS > 3
61
-  #endif // EXTRUDERS > 2
62
-#endif // EXTRUDERS > 1
46
+#if EXTRUDERS
47
+  void _lcd_refresh_e_factor_0() { planner.refresh_e_factor(0); }
48
+  #if EXTRUDERS > 1
49
+    void _lcd_refresh_e_factor() { planner.refresh_e_factor(active_extruder); }
50
+    void _lcd_refresh_e_factor_1() { planner.refresh_e_factor(1); }
51
+    #if EXTRUDERS > 2
52
+      void _lcd_refresh_e_factor_2() { planner.refresh_e_factor(2); }
53
+      #if EXTRUDERS > 3
54
+        void _lcd_refresh_e_factor_3() { planner.refresh_e_factor(3); }
55
+        #if EXTRUDERS > 4
56
+          void _lcd_refresh_e_factor_4() { planner.refresh_e_factor(4); }
57
+          #if EXTRUDERS > 5
58
+            void _lcd_refresh_e_factor_5() { planner.refresh_e_factor(5); }
59
+          #endif // EXTRUDERS > 5
60
+        #endif // EXTRUDERS > 4
61
+      #endif // EXTRUDERS > 3
62
+    #endif // EXTRUDERS > 2
63
+  #endif // EXTRUDERS > 1
64
+#endif // EXTRUDERS
63 65
 
64 66
 #if ENABLED(BABYSTEPPING)
65 67
 
@@ -174,7 +176,7 @@ void menu_tune() {
174 176
   //
175 177
   #if EXTRUDERS == 1
176 178
     MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[0], 10, 999, _lcd_refresh_e_factor_0);
177
-  #else // EXTRUDERS > 1
179
+  #elif EXTRUDERS
178 180
     MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, _lcd_refresh_e_factor);
179 181
     #define EDIT_FLOW(N) MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_LCD_N##N, &planner.flow_percentage[N], 10, 999, _lcd_refresh_e_factor_##N)
180 182
     EDIT_FLOW(0);
@@ -191,7 +193,7 @@ void menu_tune() {
191 193
         #endif // EXTRUDERS > 4
192 194
       #endif // EXTRUDERS > 3
193 195
     #endif // EXTRUDERS > 2
194
-  #endif // EXTRUDERS > 1
196
+  #endif // EXTRUDERS
195 197
 
196 198
   //
197 199
   // Babystep X:

+ 5
- 1
Marlin/src/module/stepper_indirection.h View File

@@ -628,8 +628,12 @@ void reset_stepper_drivers();    // Called by settings.load / settings.reset
628 628
     #define   NORM_E_DIR(E)   do{ if (E == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } }while(0)
629 629
     #define    REV_E_DIR(E)   do{ if (E == 0) { E0_DIR_WRITE( INVERT_E0_DIR); } else { E1_DIR_WRITE( INVERT_E1_DIR); } }while(0)
630 630
   #endif
631
-#else
631
+#elif E_STEPPERS
632 632
   #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V)
633 633
   #define   NORM_E_DIR(E)   E0_DIR_WRITE(!INVERT_E0_DIR)
634 634
   #define    REV_E_DIR(E)   E0_DIR_WRITE( INVERT_E0_DIR)
635
+#else
636
+  #define E_STEP_WRITE(E,V) NOOP
637
+  #define   NORM_E_DIR(E)   NOOP
638
+  #define    REV_E_DIR(E)   NOOP
635 639
 #endif

+ 53
- 41
Marlin/src/pins/sensitive_pins.h View File

@@ -133,25 +133,28 @@
133 133
                  || (ENABLED(SWITCHING_EXTRUDER) && E_STEPPERS > N) \
134 134
                  || (DISABLED(SWITCHING_EXTRUDER) && DISABLED(MIXING_EXTRUDER) && EXTRUDERS > N)
135 135
 
136
-#if PIN_EXISTS(E0_CS)
137
-  #define _E0_CS E0_CS_PIN,
138
-#else
139
-  #define _E0_CS
140
-#endif
141
-#if PIN_EXISTS(E0_MS1)
142
-  #define _E0_MS1 E0_MS1_PIN,
143
-#else
144
-  #define _E0_MS1
145
-#endif
146
-#if PIN_EXISTS(E0_MS2)
147
-  #define _E0_MS2 E0_MS2_PIN,
148
-#else
149
-  #define _E0_MS2
150
-#endif
151
-#if PIN_EXISTS(E0_MS3)
152
-  #define _E0_MS3 E0_MS3_PIN,
153
-#else
154
-  #define _E0_MS3
136
+#define _E0_CS
137
+#define _E0_MS1
138
+#define _E0_MS2
139
+#define _E0_MS3
140
+
141
+#if E_NEEDED(0)
142
+  #if PIN_EXISTS(E0_CS)
143
+    #undef _E0_CS
144
+    #define _E0_CS E0_CS_PIN,
145
+  #endif
146
+  #if PIN_EXISTS(E0_MS1)
147
+    #undef _E0_MS1
148
+    #define _E0_MS1 E0_MS1_PIN,
149
+  #endif
150
+  #if PIN_EXISTS(E0_MS2)
151
+    #undef _E0_MS2
152
+    #define _E0_MS2 E0_MS2_PIN,
153
+  #endif
154
+  #if PIN_EXISTS(E0_MS3)
155
+    #undef _E0_MS3
156
+    #define _E0_MS3 E0_MS3_PIN,
157
+  #endif
155 158
 #endif
156 159
 
157 160
 #define _E1_CS
@@ -278,13 +281,18 @@
278 281
 // E Steppers
279 282
 //
280 283
 
281
-#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, _E0_CS _E0_MS1 _E0_MS2 _E0_MS3
284
+#define _E0_PINS
282 285
 #define _E1_PINS
283 286
 #define _E2_PINS
284 287
 #define _E3_PINS
285 288
 #define _E4_PINS
286 289
 #define _E5_PINS
287 290
 
291
+#if EXTRUDERS
292
+  #undef _E0_PINS
293
+  #define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, _E0_CS _E0_MS1 _E0_MS2 _E0_MS3
294
+#endif
295
+
288 296
 #if ENABLED(SWITCHING_EXTRUDER)
289 297
                       // Tools 0 and 1 use E0
290 298
   #if EXTRUDERS > 2   // Tools 2 and 3 use E1
@@ -320,33 +328,37 @@
320 328
 // Heaters, Fans, Temp Sensors
321 329
 //
322 330
 
323
-#define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_0_PIN),
331
+#define _H0_PINS
324 332
 #define _H1_PINS
325 333
 #define _H2_PINS
326 334
 #define _H3_PINS
327 335
 #define _H4_PINS
328 336
 #define _H5_PINS
329 337
 
330
-#if HOTENDS > 1
331
-  #undef _H1_PINS
332
-  #define _H1_PINS HEATER_1_PIN, E1_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_1_PIN),
333
-  #if HOTENDS > 2
334
-    #undef _H2_PINS
335
-    #define _H2_PINS HEATER_2_PIN, E2_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_2_PIN),
336
-    #if HOTENDS > 3
337
-      #undef _H3_PINS
338
-      #define _H3_PINS HEATER_3_PIN, E3_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_3_PIN),
339
-      #if HOTENDS > 4
340
-        #undef _H4_PINS
341
-        #define _H4_PINS HEATER_4_PIN, E4_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_4_PIN),
342
-        #if HOTENDS > 5
343
-          #undef _H5_PINS
344
-          #define _H5_PINS HEATER_5_PIN, E5_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_5_PIN),
345
-        #endif // HOTENDS > 5
346
-      #endif // HOTENDS > 4
347
-    #endif // HOTENDS > 3
348
-  #endif // HOTENDS > 2
349
-#endif // HOTENDS > 1
338
+#if HOTENDS
339
+  #undef _H0_PINS
340
+  #define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_0_PIN),
341
+  #if HOTENDS > 1
342
+    #undef _H1_PINS
343
+    #define _H1_PINS HEATER_1_PIN, E1_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_1_PIN),
344
+    #if HOTENDS > 2
345
+      #undef _H2_PINS
346
+      #define _H2_PINS HEATER_2_PIN, E2_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_2_PIN),
347
+      #if HOTENDS > 3
348
+        #undef _H3_PINS
349
+        #define _H3_PINS HEATER_3_PIN, E3_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_3_PIN),
350
+        #if HOTENDS > 4
351
+          #undef _H4_PINS
352
+          #define _H4_PINS HEATER_4_PIN, E4_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_4_PIN),
353
+          #if HOTENDS > 5
354
+            #undef _H5_PINS
355
+            #define _H5_PINS HEATER_5_PIN, E5_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_5_PIN),
356
+          #endif // HOTENDS > 5
357
+        #endif // HOTENDS > 4
358
+      #endif // HOTENDS > 3
359
+    #endif // HOTENDS > 2
360
+  #endif // HOTENDS > 1
361
+#endif // HOTENDS
350 362
 
351 363
 #define _BED_PINS HEATER_BED_PIN, analogInputToDigitalPin(TEMP_BED_PIN),
352 364
 

Loading…
Cancel
Save