Browse Source

⚰️ Remove obsolete CUSTOM_SPI_PINS (#22058)

Victor Oliveira 3 years ago
parent
commit
ce5dece3b5
No account linked to committer's email address

+ 3
- 5
Marlin/src/HAL/STM32/HAL_SPI.cpp View File

163
     }
163
     }
164
     spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0);
164
     spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0);
165
 
165
 
166
-    #if ENABLED(CUSTOM_SPI_PINS)
167
-      SPI.setMISO(SD_MISO_PIN);
168
-      SPI.setMOSI(SD_MOSI_PIN);
169
-      SPI.setSCLK(SD_SCK_PIN);
170
-    #endif
166
+    SPI.setMISO(SD_MISO_PIN);
167
+    SPI.setMOSI(SD_MOSI_PIN);
168
+    SPI.setSCLK(SD_SCK_PIN);
171
 
169
 
172
     SPI.begin();
170
     SPI.begin();
173
   }
171
   }

+ 3
- 0
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h View File

276
 
276
 
277
 #if SD_CONNECTION_IS(ONBOARD)
277
 #if SD_CONNECTION_IS(ONBOARD)
278
   #define SD_DETECT_PIN                     PC4
278
   #define SD_DETECT_PIN                     PC4
279
+  #define SD_SCK_PIN                        PA5
280
+  #define SD_MISO_PIN                       PA6
281
+  #define SD_MOSI_PIN                       PA7
279
 #elif SD_CONNECTION_IS(LCD) && BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050)
282
 #elif SD_CONNECTION_IS(LCD) && BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050)
280
   #define SD_DETECT_PIN                     PA15
283
   #define SD_DETECT_PIN                     PA15
281
   #define SD_SS_PIN                         PA10
284
   #define SD_SS_PIN                         PA10

+ 5
- 8
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h View File

280
 #define ONBOARD_SPI_DEVICE                     1  // SPI1 -> used only by HAL/STM32F1...
280
 #define ONBOARD_SPI_DEVICE                     1  // SPI1 -> used only by HAL/STM32F1...
281
 #define ONBOARD_SD_CS_PIN                   PA4   // Chip select for "System" SD card
281
 #define ONBOARD_SD_CS_PIN                   PA4   // Chip select for "System" SD card
282
 
282
 
283
-#define CUSTOM_SPI_PINS                           // TODO: needed because is the only way to set SPI for SD on STM32 (for now)
284
-#if ENABLED(CUSTOM_SPI_PINS)
285
-  #define ENABLE_SPI1
286
-  #define SDSS                              ONBOARD_SD_CS_PIN
287
-  #define SD_SCK_PIN                        PA5
288
-  #define SD_MISO_PIN                       PA6
289
-  #define SD_MOSI_PIN                       PA7
290
-#endif
283
+#define ENABLE_SPI1
284
+#define SDSS                   ONBOARD_SD_CS_PIN
285
+#define SD_SCK_PIN                          PA5
286
+#define SD_MISO_PIN                         PA6
287
+#define SD_MOSI_PIN                         PA7

+ 0
- 1
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h View File

186
 
186
 
187
 // TODO: This is the only way to set SPI for SD on STM32 (for now)
187
 // TODO: This is the only way to set SPI for SD on STM32 (for now)
188
 #define ENABLE_SPI2
188
 #define ENABLE_SPI2
189
-#define CUSTOM_SPI_PINS
190
 #define SD_SCK_PIN                          PB13
189
 #define SD_SCK_PIN                          PB13
191
 #define SD_MISO_PIN                         PB14
190
 #define SD_MISO_PIN                         PB14
192
 #define SD_MOSI_PIN                         PB15
191
 #define SD_MOSI_PIN                         PB15

+ 4
- 7
Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h View File

205
 #define EXP2_10_PIN                         PA6
205
 #define EXP2_10_PIN                         PA6
206
 
206
 
207
 // HAL SPI1 pins
207
 // HAL SPI1 pins
208
-#define CUSTOM_SPI_PINS
209
-#if ENABLED(CUSTOM_SPI_PINS)
210
-  #define SD_SCK_PIN                 EXP2_09_PIN  // SPI1 SCLK
211
-  #define SD_SS_PIN                  EXP2_07_PIN  // SPI1 SSEL
212
-  #define SD_MISO_PIN                EXP2_10_PIN  // SPI1 MISO
213
-  #define SD_MOSI_PIN                EXP2_05_PIN  // SPI1 MOSI
214
-#endif
208
+#define SD_SCK_PIN                   EXP2_09_PIN  // SPI1 SCLK
209
+#define SD_SS_PIN                    EXP2_07_PIN  // SPI1 SSEL
210
+#define SD_MISO_PIN                  EXP2_10_PIN  // SPI1 MISO
211
+#define SD_MOSI_PIN                  EXP2_05_PIN  // SPI1 MOSI
215
 
212
 
216
 #define SDSS                         EXP2_07_PIN
213
 #define SDSS                         EXP2_07_PIN
217
 
214
 

+ 0
- 2
Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h View File

357
 
357
 
358
 #elif SD_CONNECTION_IS(ONBOARD)
358
 #elif SD_CONNECTION_IS(ONBOARD)
359
 
359
 
360
-  // Instruct the STM32 HAL to override the default SPI pins from the variant.h file
361
-  #define CUSTOM_SPI_PINS
362
   #define SDSS                              PA4
360
   #define SDSS                              PA4
363
   #define SD_SS_PIN                         SDSS
361
   #define SD_SS_PIN                         SDSS
364
   #define SD_SCK_PIN                        PA5
362
   #define SD_SCK_PIN                        PA5

+ 0
- 1
Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h View File

356
   #define SD_DETECT_PIN                     PC14
356
   #define SD_DETECT_PIN                     PC14
357
 #elif SD_CONNECTION_IS(LCD)
357
 #elif SD_CONNECTION_IS(LCD)
358
 
358
 
359
-  #define CUSTOM_SPI_PINS
360
   #define SDSS                              PA4
359
   #define SDSS                              PA4
361
   #define SD_SS_PIN                         SDSS
360
   #define SD_SS_PIN                         SDSS
362
   #define SD_SCK_PIN                        PA5
361
   #define SD_SCK_PIN                        PA5

+ 0
- 1
Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h View File

348
 
348
 
349
 #elif SD_CONNECTION_IS(LCD)
349
 #elif SD_CONNECTION_IS(LCD)
350
 
350
 
351
-  #define CUSTOM_SPI_PINS
352
   #define SDSS                              PA4
351
   #define SDSS                              PA4
353
   #define SD_SS_PIN                         SDSS
352
   #define SD_SS_PIN                         SDSS
354
   #define SD_SCK_PIN                        PA5
353
   #define SD_SCK_PIN                        PA5

+ 14
- 20
Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h View File

217
 //
217
 //
218
 // detect pin dont work when ONBOARD and NO_SD_HOST_DRIVE disabled
218
 // detect pin dont work when ONBOARD and NO_SD_HOST_DRIVE disabled
219
 #if SD_CONNECTION_IS(ONBOARD)
219
 #if SD_CONNECTION_IS(ONBOARD)
220
-  #define CUSTOM_SPI_PINS                         // TODO: needed because is the only way to set SPI3 for SD on STM32 (by now)
221
-  #if ENABLED(CUSTOM_SPI_PINS)
222
-    #define ENABLE_SPI3
223
-    #define SD_SS_PIN                       -1
224
-    #define SDSS                            PC9
225
-    #define SD_SCK_PIN                      PC10
226
-    #define SD_MISO_PIN                     PC11
227
-    #define SD_MOSI_PIN                     PC12
228
-    #define SD_DETECT_PIN                   PD12
229
-  #endif
220
+  #define ENABLE_SPI3
221
+  #define SD_SS_PIN                         -1
222
+  #define SDSS                              PC9
223
+  #define SD_SCK_PIN                        PC10
224
+  #define SD_MISO_PIN                       PC11
225
+  #define SD_MOSI_PIN                       PC12
226
+  #define SD_DETECT_PIN                     PD12
230
 #endif
227
 #endif
231
 
228
 
232
 //
229
 //
233
 // LCD SD
230
 // LCD SD
234
 //
231
 //
235
 #if SD_CONNECTION_IS(LCD)
232
 #if SD_CONNECTION_IS(LCD)
236
-  #define CUSTOM_SPI_PINS
237
-  #if ENABLED(CUSTOM_SPI_PINS)
238
-    #define ENABLE_SPI1
239
-    #define SDSS                            PE10
240
-    #define SD_SCK_PIN                      PA5
241
-    #define SD_MISO_PIN                     PA6
242
-    #define SD_MOSI_PIN                     PA7
243
-    #define SD_DETECT_PIN                   PE12
244
-  #endif
233
+  #define ENABLE_SPI1
234
+  #define SDSS                              PE10
235
+  #define SD_SCK_PIN                        PA5
236
+  #define SD_MISO_PIN                       PA6
237
+  #define SD_MOSI_PIN                       PA7
238
+  #define SD_DETECT_PIN                     PE12
245
 #endif
239
 #endif
246
 
240
 
247
 //
241
 //
248
 // LCD / Controller
242
 // LCD / Controller
249
 #define SPI_FLASH
243
 #define SPI_FLASH
250
-#define HAS_SPI_FLASH                          1
244
+#define HAS_SPI_FLASH 1
251
 #define SPI_DEVICE                             2
245
 #define SPI_DEVICE                             2
252
 #define SPI_FLASH_SIZE                 0x1000000
246
 #define SPI_FLASH_SIZE                 0x1000000
253
 #if ENABLED(SPI_FLASH)
247
 #if ENABLED(SPI_FLASH)

+ 20
- 27
Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h View File

31
 #define BOARD_INFO_NAME "MKS Robin PRO V2"
31
 #define BOARD_INFO_NAME "MKS Robin PRO V2"
32
 
32
 
33
 // Avoid conflict with TIMER_TONE
33
 // Avoid conflict with TIMER_TONE
34
-#define STEP_TIMER                            10
34
+#define STEP_TIMER 10
35
 
35
 
36
 // Use one of these or SDCard-based Emulation will be used
36
 // Use one of these or SDCard-based Emulation will be used
37
 //#define SRAM_EEPROM_EMULATION                   // Use BackSRAM-based EEPROM emulation
37
 //#define SRAM_EEPROM_EMULATION                   // Use BackSRAM-based EEPROM emulation
50
 //
50
 //
51
 // Note: MKS Robin board is using SPI2 interface.
51
 // Note: MKS Robin board is using SPI2 interface.
52
 //
52
 //
53
-//#define SPI_MODULE                           2
53
+//#define SPI_MODULE 2
54
 
54
 
55
 //
55
 //
56
 // Servos
56
 // Servos
203
 //#define LED_PIN                           PB2
203
 //#define LED_PIN                           PB2
204
 
204
 
205
 #ifndef SDCARD_CONNECTION
205
 #ifndef SDCARD_CONNECTION
206
-  #define SDCARD_CONNECTION              ONBOARD
206
+  #define SDCARD_CONNECTION ONBOARD
207
 #endif
207
 #endif
208
 
208
 
209
 //#define USE_NEW_SPI_API 1
209
 //#define USE_NEW_SPI_API 1
214
 //
214
 //
215
 // detect pin dont work when ONBOARD and NO_SD_HOST_DRIVE disabled
215
 // detect pin dont work when ONBOARD and NO_SD_HOST_DRIVE disabled
216
 #if !defined(SDCARD_CONNECTION) || SDCARD_CONNECTION == ONBOARD
216
 #if !defined(SDCARD_CONNECTION) || SDCARD_CONNECTION == ONBOARD
217
-  #define CUSTOM_SPI_PINS
218
-  #if ENABLED(CUSTOM_SPI_PINS)
219
-
220
-    #if USE_NEW_SPI_API
221
-      #define SD_SPI MARLIN_SPI(HardwareSPI3, PC9)
222
-    #else
223
-      #define ENABLE_SPI3
224
-      #define SD_SS_PIN                     -1
225
-      #define SDSS                          PC9
226
-      #define SD_SCK_PIN                    PC10
227
-      #define SD_MISO_PIN                   PC11
228
-      #define SD_MOSI_PIN                   PC12
229
-    #endif
230
-    #define SD_DETECT_PIN                   PD12
217
+  #if USE_NEW_SPI_API
218
+    #define SD_SPI MARLIN_SPI(HardwareSPI3, PC9)
219
+  #else
220
+    #define ENABLE_SPI3
221
+    #define SD_SS_PIN                       -1
222
+    #define SDSS                            PC9
223
+    #define SD_SCK_PIN                      PC10
224
+    #define SD_MISO_PIN                     PC11
225
+    #define SD_MOSI_PIN                     PC12
231
   #endif
226
   #endif
227
+  #define SD_DETECT_PIN                     PD12
232
 #endif
228
 #endif
233
 
229
 
234
 /*
230
 /*
236
 // LCD SD
232
 // LCD SD
237
 //
233
 //
238
 #if SDCARD_CONNECTION == LCD
234
 #if SDCARD_CONNECTION == LCD
239
-  #define CUSTOM_SPI_PINS
240
-  #if ENABLED(CUSTOM_SPI_PINS)
241
-    #define ENABLE_SPI1
242
-    #define SDSS                            PE10
243
-    #define SD_SCK_PIN                      PA5
244
-    #define SD_MISO_PIN                     PA6
245
-    #define SD_MOSI_PIN                     PA7
246
-    #define SD_DETECT_PIN                   PE12
247
-  #endif
235
+  #define ENABLE_SPI1
236
+  #define SDSS                              PE10
237
+  #define SD_SCK_PIN                        PA5
238
+  #define SD_MISO_PIN                       PA6
239
+  #define SD_MOSI_PIN                       PA7
240
+  #define SD_DETECT_PIN                     PE12
248
 #endif
241
 #endif
249
 */
242
 */
250
 
243
 
251
 //
244
 //
252
 // LCD / Controller
245
 // LCD / Controller
253
 #define SPI_FLASH
246
 #define SPI_FLASH
254
-#define HAS_SPI_FLASH                          1
247
+#define HAS_SPI_FLASH 1
255
 #define SPI_DEVICE                             2
248
 #define SPI_DEVICE                             2
256
 #define SPI_FLASH_SIZE                 0x1000000
249
 #define SPI_FLASH_SIZE                 0x1000000
257
 #if ENABLED(SPI_FLASH)
250
 #if ENABLED(SPI_FLASH)

Loading…
Cancel
Save