Procházet zdrojové kódy

Allow BTT EXP-MOT be used with Displays that needs only EXP 1 (#20396)

Co-authored-by: ellensp <ellensp@ellensp-HP-ProBook-6470b.fritz.box>
Co-authored-by: Victor Mateus Oliveira <rhapsodyv@gmail.com>
ellensp před 4 roky
rodič
revize
fee375f31f
No account linked to committer's email address
1 změnil soubory, kde provedl 34 přidání a 18 odebrání
  1. 34
    18
      Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h

+ 34
- 18
Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h Zobrazit soubor

@@ -34,7 +34,11 @@
34 34
 //#define HAS_BTT_EXP_MOT 1
35 35
 
36 36
 #if BOTH(HAS_WIRED_LCD,HAS_BTT_EXP_MOT)
37
-  #ERROR "Having a LCD on EXP1/EXP2 and a expanion motor module on EXP1/EXP2 is not possable."
37
+  #if EITHER(CR10_STOCKDISPLAY,ENDER2_STOCKDISPLAY)
38
+    #define EXP_MOT_USE_EXP2_ONLY
39
+  #else
40
+    #error "Having a LCD that uses both EXP1/EXP2 and a expanion motor module on EXP1/EXP2 is not possible."
41
+  #endif
38 42
 #endif
39 43
 
40 44
 // Ignore temp readings during development.
@@ -133,36 +137,48 @@
133 137
  * (M3DIR) 0.15 | · · | 0.17 (M3STP)           (M3RX) 0.28 | · · | 1.30 (M3DIAG)
134 138
  *               -----                                      -----
135 139
  *               EXP2                                       EXP1
140
+ *
141
+ * NB In EXP_MOT_USE_EXP2_ONLY mode EXP1 is not used and M2EN and M3EN need to be jumpered to M1EN
136 142
  */
137 143
 
138 144
   // M1 on Driver Expansion Module
139 145
   #define E2_STEP_PIN                      EXPA2_05_PIN
140 146
   #define E2_DIR_PIN                       EXPA2_06_PIN
141 147
   #define E2_ENABLE_PIN                    EXPA2_04_PIN
142
-  #define E2_DIAG_PIN                      EXPA1_06_PIN
143
-  #define E2_CS_PIN                        EXPA1_05_PIN
144
-  #if HAS_TMC_UART
145
-    #define E2_SERIAL_TX_PIN               EXPA1_05_PIN
146
-    #define E2_SERIAL_RX_PIN               EXPA1_05_PIN
148
+  #ifndef EXP_MOT_USE_EXP2_ONLY
149
+    #define E2_DIAG_PIN                    EXPA1_06_PIN
150
+    #define E2_CS_PIN                      EXPA1_05_PIN
151
+    #if HAS_TMC_UART
152
+      #define E2_SERIAL_TX_PIN             EXPA1_05_PIN
153
+      #define E2_SERIAL_RX_PIN             EXPA1_05_PIN
154
+    #endif
147 155
   #endif
148 156
   // M2 on Driver Expansion Module
149 157
   #define E3_STEP_PIN                      EXPA2_08_PIN
150 158
   #define E3_DIR_PIN                       EXPA2_07_PIN
151
-  #define E3_ENABLE_PIN                    EXPA1_03_PIN
152
-  #define E3_DIAG_PIN                      EXPA1_08_PIN
153
-  #define E3_CS_PIN                        EXPA1_07_PIN
154
-  #if HAS_TMC_UART
155
-    #define E3_SERIAL_TX_PIN               EXPA1_07_PIN
156
-    #define E3_SERIAL_RX_PIN               EXPA1_07_PIN
159
+  #ifndef EXP_MOT_USE_EXP2_ONLY
160
+    #define E3_ENABLE_PIN                  EXPA1_03_PIN
161
+    #define E3_DIAG_PIN                    EXPA1_08_PIN
162
+    #define E3_CS_PIN                      EXPA1_07_PIN
163
+    #if HAS_TMC_UART
164
+      #define E3_SERIAL_TX_PIN             EXPA1_07_PIN
165
+      #define E3_SERIAL_RX_PIN             EXPA1_07_PIN
166
+    #endif
167
+  #else
168
+    #define E3_ENABLE_PIN                  EXPA2_04_PIN
157 169
   #endif
158 170
   // M3 on Driver Expansion Module
159 171
   #define E4_STEP_PIN                      EXPA2_10_PIN
160 172
   #define E4_DIR_PIN                       EXPA2_09_PIN
161
-  #define E4_ENABLE_PIN                    EXPA1_04_PIN
162
-  #define E4_DIAG_PIN                      EXPA1_10_PIN
163
-  #define E4_CS_PIN                        EXPA1_09_PIN
164
-  #if HAS_TMC_UART
165
-    #define E4_SERIAL_TX_PIN               EXPA1_09_PIN
166
-    #define E4_SERIAL_RX_PIN               EXPA1_09_PIN
173
+  #ifndef EXP_MOT_USE_EXP2_ONLY
174
+    #define E4_ENABLE_PIN                  EXPA1_04_PIN
175
+    #define E4_DIAG_PIN                    EXPA1_10_PIN
176
+    #define E4_CS_PIN                      EXPA1_09_PIN
177
+    #if HAS_TMC_UART
178
+      #define E4_SERIAL_TX_PIN             EXPA1_09_PIN
179
+      #define E4_SERIAL_RX_PIN             EXPA1_09_PIN
180
+    #endif
181
+  #else
182
+    #define E4_ENABLE_PIN                  EXPA2_04_PIN
167 183
   #endif
168 184
 #endif // HAS_BTT_EXP_MOT

Loading…
Zrušit
Uložit