Browse Source

Fix automatic stepper assignment for X/Y/Z dual stepper drivers (#8130)

Thomas Moore 7 years ago
parent
commit
325233b454
2 changed files with 48 additions and 5 deletions
  1. 0
    2
      Marlin/src/module/temperature.h
  2. 48
    3
      Marlin/src/pins/pins.h

+ 0
- 2
Marlin/src/module/temperature.h View File

29
 
29
 
30
 #include "thermistor/thermistors.h"
30
 #include "thermistor/thermistors.h"
31
 
31
 
32
-#include "../inc/MarlinConfig.h"
33
-
34
 #if ENABLED(BABYSTEPPING)
32
 #if ENABLED(BABYSTEPPING)
35
   extern bool axis_known_position[XYZ];
33
   extern bool axis_known_position[XYZ];
36
 #endif
34
 #endif

+ 48
- 3
Marlin/src/pins/pins.h View File

329
 #ifndef Z_MS2_PIN
329
 #ifndef Z_MS2_PIN
330
   #define Z_MS2_PIN -1
330
   #define Z_MS2_PIN -1
331
 #endif
331
 #endif
332
+#ifndef E0_STEP_PIN
333
+  #define E0_STEP_PIN -1
334
+#endif
335
+#ifndef E0_DIR_PIN
336
+  #define E0_DIR_PIN -1
337
+#endif
338
+#ifndef E0_ENABLE_PIN
339
+  #define E0_ENABLE_PIN -1
340
+#endif
332
 #ifndef E0_MS1_PIN
341
 #ifndef E0_MS1_PIN
333
   #define E0_MS1_PIN -1
342
   #define E0_MS1_PIN -1
334
 #endif
343
 #endif
335
 #ifndef E0_MS2_PIN
344
 #ifndef E0_MS2_PIN
336
   #define E0_MS2_PIN -1
345
   #define E0_MS2_PIN -1
337
 #endif
346
 #endif
347
+#ifndef E1_STEP_PIN
348
+  #define E1_STEP_PIN -1
349
+#endif
350
+#ifndef E1_DIR_PIN
351
+  #define E1_DIR_PIN -1
352
+#endif
353
+#ifndef E1_ENABLE_PIN
354
+  #define E1_ENABLE_PIN -1
355
+#endif
338
 #ifndef E1_MS1_PIN
356
 #ifndef E1_MS1_PIN
339
   #define E1_MS1_PIN -1
357
   #define E1_MS1_PIN -1
340
 #endif
358
 #endif
341
 #ifndef E1_MS2_PIN
359
 #ifndef E1_MS2_PIN
342
   #define E1_MS2_PIN -1
360
   #define E1_MS2_PIN -1
343
 #endif
361
 #endif
362
+#ifndef E2_STEP_PIN
363
+  #define E2_STEP_PIN -1
364
+#endif
365
+#ifndef E2_DIR_PIN
366
+  #define E2_DIR_PIN -1
367
+#endif
368
+#ifndef E2_ENABLE_PIN
369
+  #define E2_ENABLE_PIN -1
370
+#endif
371
+#ifndef E3_STEP_PIN
372
+  #define E3_STEP_PIN -1
373
+#endif
374
+#ifndef E3_DIR_PIN
375
+  #define E3_DIR_PIN -1
376
+#endif
377
+#ifndef E3_ENABLE_PIN
378
+  #define E3_ENABLE_PIN -1
379
+#endif
380
+#ifndef E4_STEP_PIN
381
+  #define E4_STEP_PIN -1
382
+#endif
383
+#ifndef E4_DIR_PIN
384
+  #define E4_DIR_PIN -1
385
+#endif
386
+#ifndef E4_ENABLE_PIN
387
+  #define E4_ENABLE_PIN -1
388
+#endif
344
 
389
 
345
 #ifndef FAN_PIN
390
 #ifndef FAN_PIN
346
   #define FAN_PIN -1
391
   #define FAN_PIN -1
623
     #define X2_STEP_PIN   _EPIN(E_STEPPERS, STEP)
668
     #define X2_STEP_PIN   _EPIN(E_STEPPERS, STEP)
624
     #define X2_DIR_PIN    _EPIN(E_STEPPERS, DIR)
669
     #define X2_DIR_PIN    _EPIN(E_STEPPERS, DIR)
625
     #define X2_ENABLE_PIN _EPIN(E_STEPPERS, ENABLE)
670
     #define X2_ENABLE_PIN _EPIN(E_STEPPERS, ENABLE)
626
-    #if X2_ENABLE_PIN == 0
671
+    #if E_STEPPERS > 4 || !PIN_EXISTS(X2_ENABLE)
627
       #error "No E stepper plug left for X2!"
672
       #error "No E stepper plug left for X2!"
628
     #endif
673
     #endif
629
   #endif
674
   #endif
640
     #define Y2_STEP_PIN   _EPIN(Y2_E_INDEX, STEP)
685
     #define Y2_STEP_PIN   _EPIN(Y2_E_INDEX, STEP)
641
     #define Y2_DIR_PIN    _EPIN(Y2_E_INDEX, DIR)
686
     #define Y2_DIR_PIN    _EPIN(Y2_E_INDEX, DIR)
642
     #define Y2_ENABLE_PIN _EPIN(Y2_E_INDEX, ENABLE)
687
     #define Y2_ENABLE_PIN _EPIN(Y2_E_INDEX, ENABLE)
643
-    #if Y2_ENABLE_PIN == 0
688
+    #if Y2_E_INDEX > 4 || !PIN_EXISTS(Y2_ENABLE)
644
       #error "No E stepper plug left for Y2!"
689
       #error "No E stepper plug left for Y2!"
645
     #endif
690
     #endif
646
   #endif
691
   #endif
657
     #define Z2_STEP_PIN   _EPIN(Z2_E_INDEX, STEP)
702
     #define Z2_STEP_PIN   _EPIN(Z2_E_INDEX, STEP)
658
     #define Z2_DIR_PIN    _EPIN(Z2_E_INDEX, DIR)
703
     #define Z2_DIR_PIN    _EPIN(Z2_E_INDEX, DIR)
659
     #define Z2_ENABLE_PIN _EPIN(Z2_E_INDEX, ENABLE)
704
     #define Z2_ENABLE_PIN _EPIN(Z2_E_INDEX, ENABLE)
660
-    #if Z2_ENABLE_PIN == 0
705
+    #if Z2_E_INDEX > 4 || !PIN_EXISTS(Z2_ENABLE)
661
       #error "No E stepper plug left for Z2!"
706
       #error "No E stepper plug left for Z2!"
662
     #endif
707
     #endif
663
   #endif
708
   #endif

Loading…
Cancel
Save