浏览代码

Followup to auto-assign of dual axis CS pins

Scott Lahteine 7 年前
父节点
当前提交
18de11c1ea
共有 1 个文件被更改,包括 27 次插入6 次删除
  1. 27
    6
      Marlin/src/pins/pins.h

+ 27
- 6
Marlin/src/pins/pins.h 查看文件

@@ -793,13 +793,20 @@
793 793
     #define X2_STEP_PIN   _EPIN(E_STEPPERS, STEP)
794 794
     #define X2_DIR_PIN    _EPIN(E_STEPPERS, DIR)
795 795
     #define X2_ENABLE_PIN _EPIN(E_STEPPERS, ENABLE)
796
-    #define X2_CS_PIN     _EPIN(E_STEPPERS, CS)
796
+    #ifndef X2_CS_PIN
797
+      #define X2_CS_PIN   _EPIN(E_STEPPERS, CS)
798
+    #endif
797 799
     #if E_STEPPERS > 4 || !PIN_EXISTS(X2_ENABLE)
798 800
       #error "No E stepper plug left for X2!"
799 801
     #endif
800 802
   #endif
801 803
   #undef _X2_PINS
802
-  #define _X2_PINS X2_STEP_PIN, X2_DIR_PIN, X2_ENABLE_PIN, X2_CS_PIN,
804
+  #define __X2_PINS X2_STEP_PIN, X2_DIR_PIN, X2_ENABLE_PIN,
805
+  #ifdef X2_CS_PIN
806
+    #define _X2_PINS __X2_PINS X2_CS_PIN,
807
+  #else
808
+    #define _X2_PINS __X2_PINS
809
+  #endif
803 810
   #define Y2_E_INDEX INCREMENT(E_STEPPERS)
804 811
 #else
805 812
   #define Y2_E_INDEX E_STEPPERS
@@ -811,13 +818,20 @@
811 818
     #define Y2_STEP_PIN   _EPIN(Y2_E_INDEX, STEP)
812 819
     #define Y2_DIR_PIN    _EPIN(Y2_E_INDEX, DIR)
813 820
     #define Y2_ENABLE_PIN _EPIN(Y2_E_INDEX, ENABLE)
814
-    #define Y2_CS_PIN     _EPIN(Y2_E_INDEX, CS)
821
+    #ifndef Y2_CS_PIN
822
+      #define Y2_CS_PIN   _EPIN(Y2_E_INDEX, CS)
823
+    #endif
815 824
     #if Y2_E_INDEX > 4 || !PIN_EXISTS(Y2_ENABLE)
816 825
       #error "No E stepper plug left for Y2!"
817 826
     #endif
818 827
   #endif
819 828
   #undef _Y2_PINS
820
-  #define _Y2_PINS Y2_STEP_PIN, Y2_DIR_PIN, Y2_ENABLE_PIN, Y2_CS_PIN,
829
+  #define __Y2_PINS Y2_STEP_PIN, Y2_DIR_PIN, Y2_ENABLE_PIN,
830
+  #ifdef Y2_CS_PIN
831
+    #define _Y2_PINS __Y2_PINS Y2_CS_PIN,
832
+  #else
833
+    #define _Y2_PINS __Y2_PINS
834
+  #endif
821 835
   #define Z2_E_INDEX INCREMENT(Y2_E_INDEX)
822 836
 #else
823 837
   #define Z2_E_INDEX Y2_E_INDEX
@@ -829,13 +843,20 @@
829 843
     #define Z2_STEP_PIN   _EPIN(Z2_E_INDEX, STEP)
830 844
     #define Z2_DIR_PIN    _EPIN(Z2_E_INDEX, DIR)
831 845
     #define Z2_ENABLE_PIN _EPIN(Z2_E_INDEX, ENABLE)
832
-    #define Z2_CS_PIN     _EPIN(Z2_E_INDEX, CS)
846
+    #ifndef Z2_CS_PIN
847
+      #define Z2_CS_PIN   _EPIN(Z2_E_INDEX, CS)
848
+    #endif
833 849
     #if Z2_E_INDEX > 4 || !PIN_EXISTS(Z2_ENABLE)
834 850
       #error "No E stepper plug left for Z2!"
835 851
     #endif
836 852
   #endif
837 853
   #undef _Z2_PINS
838
-  #define _Z2_PINS Z2_STEP_PIN, Z2_DIR_PIN, Z2_ENABLE_PIN, Z2_CS_PIN,
854
+  #define __Z2_PINS Z2_STEP_PIN, Z2_DIR_PIN, Z2_ENABLE_PIN,
855
+  #ifdef Z2_CS_PIN
856
+    #define _Z2_PINS __Z2_PINS Z2_CS_PIN,
857
+  #else
858
+    #define _Z2_PINS __Z2_PINS
859
+  #endif
839 860
 #endif
840 861
 
841 862
 #ifndef HAL_SENSITIVE_PINS

正在加载...
取消
保存