Browse Source

For Dual Y/Z use the next available extruder pins

Scott Lahteine 9 years ago
parent
commit
68457ee903
2 changed files with 19 additions and 6 deletions
  1. 3
    0
      Marlin/Conditionals.h
  2. 16
    6
      Marlin/pins.h

+ 3
- 0
Marlin/Conditionals.h View File

462
   #define HAS_E1_ENABLE (PIN_EXISTS(E1_ENABLE))
462
   #define HAS_E1_ENABLE (PIN_EXISTS(E1_ENABLE))
463
   #define HAS_E2_ENABLE (PIN_EXISTS(E2_ENABLE))
463
   #define HAS_E2_ENABLE (PIN_EXISTS(E2_ENABLE))
464
   #define HAS_E3_ENABLE (PIN_EXISTS(E3_ENABLE))
464
   #define HAS_E3_ENABLE (PIN_EXISTS(E3_ENABLE))
465
+  #define HAS_E4_ENABLE (PIN_EXISTS(E4_ENABLE))
465
   #define HAS_X_DIR (PIN_EXISTS(X_DIR))
466
   #define HAS_X_DIR (PIN_EXISTS(X_DIR))
466
   #define HAS_X2_DIR (PIN_EXISTS(X2_DIR))
467
   #define HAS_X2_DIR (PIN_EXISTS(X2_DIR))
467
   #define HAS_Y_DIR (PIN_EXISTS(Y_DIR))
468
   #define HAS_Y_DIR (PIN_EXISTS(Y_DIR))
472
   #define HAS_E1_DIR (PIN_EXISTS(E1_DIR))
473
   #define HAS_E1_DIR (PIN_EXISTS(E1_DIR))
473
   #define HAS_E2_DIR (PIN_EXISTS(E2_DIR))
474
   #define HAS_E2_DIR (PIN_EXISTS(E2_DIR))
474
   #define HAS_E3_DIR (PIN_EXISTS(E3_DIR))
475
   #define HAS_E3_DIR (PIN_EXISTS(E3_DIR))
476
+  #define HAS_E4_DIR (PIN_EXISTS(E4_DIR))
475
   #define HAS_X_STEP (PIN_EXISTS(X_STEP))
477
   #define HAS_X_STEP (PIN_EXISTS(X_STEP))
476
   #define HAS_X2_STEP (PIN_EXISTS(X2_STEP))
478
   #define HAS_X2_STEP (PIN_EXISTS(X2_STEP))
477
   #define HAS_Y_STEP (PIN_EXISTS(Y_STEP))
479
   #define HAS_Y_STEP (PIN_EXISTS(Y_STEP))
482
   #define HAS_E1_STEP (PIN_EXISTS(E1_STEP))
484
   #define HAS_E1_STEP (PIN_EXISTS(E1_STEP))
483
   #define HAS_E2_STEP (PIN_EXISTS(E2_STEP))
485
   #define HAS_E2_STEP (PIN_EXISTS(E2_STEP))
484
   #define HAS_E3_STEP (PIN_EXISTS(E3_STEP))
486
   #define HAS_E3_STEP (PIN_EXISTS(E3_STEP))
487
+  #define HAS_E4_STEP (PIN_EXISTS(E4_STEP))
485
 
488
 
486
   /**
489
   /**
487
    * Helper Macros for heaters and extruder fan
490
    * Helper Macros for heaters and extruder fan

+ 16
- 6
Marlin/pins.h View File

236
   #define Z_MIN_PIN          -1
236
   #define Z_MIN_PIN          -1
237
 #endif
237
 #endif
238
 
238
 
239
+//
240
+// Dual Y and Dual Z support
241
+// These options are mutually-exclusive
242
+//
243
+
244
+#define __EPIN(p,q) E##p##_##q##_PIN
245
+#define _EPIN(p,q) __EPIN(p,q)
246
+
247
+// The Y2 axis, if any, should be the next open extruder port
239
 #ifndef Y2_STEP_PIN
248
 #ifndef Y2_STEP_PIN
240
-  #define Y2_STEP_PIN      E1_STEP_PIN
241
-  #define Y2_DIR_PIN       E1_DIR_PIN
242
-  #define Y2_ENABLE_PIN    E1_ENABLE_PIN
249
+  #define Y2_STEP_PIN   _EPIN(EXTRUDERS, STEP)
250
+  #define Y2_DIR_PIN    _EPIN(EXTRUDERS, DIR)
251
+  #define Y2_ENABLE_PIN _EPIN(EXTRUDERS, ENABLE)
243
 #endif
252
 #endif
244
 
253
 
254
+// The Z2 axis, if any, should be the next open extruder port
245
 #ifndef Z2_STEP_PIN
255
 #ifndef Z2_STEP_PIN
246
-  #define Z2_STEP_PIN      E1_STEP_PIN
247
-  #define Z2_DIR_PIN       E1_DIR_PIN
248
-  #define Z2_ENABLE_PIN    E1_ENABLE_PIN
256
+  #define Z2_STEP_PIN   _EPIN(EXTRUDERS, STEP)
257
+  #define Z2_DIR_PIN    _EPIN(EXTRUDERS, DIR)
258
+  #define Z2_ENABLE_PIN _EPIN(EXTRUDERS, ENABLE)
249
 #endif
259
 #endif
250
 
260
 
251
 #define SENSITIVE_PINS { 0, 1, \
261
 #define SENSITIVE_PINS { 0, 1, \

Loading…
Cancel
Save