|
@@ -280,24 +280,29 @@
|
280
|
280
|
//#define FAN6_PIN PC9 // Fan6
|
281
|
281
|
//#define FAN7_PIN PE14 // Fan7
|
282
|
282
|
|
|
283
|
+#ifndef SDCARD_CONNECTION
|
|
284
|
+ #define SDCARD_CONNECTION ONBOARD
|
|
285
|
+#endif
|
|
286
|
+
|
283
|
287
|
//
|
284
|
|
-// By default the onboard SD (SPI1) is enabled
|
|
288
|
+// By default the LCD SD (SPI2) is enabled
|
|
289
|
+// Onboard SD is on a completely separate SPI bus, and requires
|
|
290
|
+// overriding pins to access.
|
285
|
291
|
//
|
286
|
|
-#define CUSTOM_SPI_PINS
|
287
|
|
-#if DISABLED(CUSTOM_SPI_PINS)
|
|
292
|
+#if SD_CONNECTION_IS(LCD)
|
|
293
|
+ #define SD_DETECT_PIN PB10
|
288
|
294
|
#define SDSS PB12
|
289
|
|
-#endif
|
290
|
|
-
|
291
|
|
-// HAL SPI1 pins group
|
292
|
|
-#if ENABLED(CUSTOM_SPI_PINS)
|
|
295
|
+#elif SD_CONNECTION_IS(ONBOARD)
|
|
296
|
+ // Instruct the STM32 HAL to override the default SPI pins from the variant.h file
|
|
297
|
+ #define CUSTOM_SPI_PINS
|
293
|
298
|
#define SDSS PA4
|
294
|
|
- #define SD_DETECT_PIN PC4
|
295
|
|
- #define LCD_SDSS PA4
|
296
|
|
-
|
|
299
|
+ #define SS_PIN SDSS
|
297
|
300
|
#define SCK_PIN PA5
|
298
|
301
|
#define MISO_PIN PA6
|
299
|
302
|
#define MOSI_PIN PA7
|
300
|
|
- #define SS_PIN PA4 // Chip select for SD card used by Marlin
|
|
303
|
+ #define SD_DETECT_PIN PC4
|
|
304
|
+#elif SD_CONNECTION_IS(CUSTOM_CABLE)
|
|
305
|
+ #define "CUSTOM_CABLE is not a supported SDCARD_CONNECTION for this board"
|
301
|
306
|
#endif
|
302
|
307
|
|
303
|
308
|
/**
|
|
@@ -319,7 +324,6 @@
|
319
|
324
|
#define BTN_ENC PA15
|
320
|
325
|
|
321
|
326
|
#if ENABLED(CR10_STOCKDISPLAY)
|
322
|
|
-
|
323
|
327
|
#define LCD_PINS_RS PG6
|
324
|
328
|
|
325
|
329
|
#define BTN_EN1 PC10
|
|
@@ -333,6 +337,15 @@
|
333
|
337
|
#undef BOARD_ST7920_DELAY_2
|
334
|
338
|
#undef BOARD_ST7920_DELAY_3
|
335
|
339
|
|
|
340
|
+ #elif ENABLED(MKS_MINI_12864)
|
|
341
|
+ #define DOGLCD_A0 PG6
|
|
342
|
+ #define DOGLCD_CS PG7
|
|
343
|
+ #define BTN_EN1 PD10
|
|
344
|
+ #define BTN_EN2 PH10
|
|
345
|
+
|
|
346
|
+ #if SD_CONNECTION_IS(ONBOARD)
|
|
347
|
+ #define SOFTWARE_SPI
|
|
348
|
+ #endif
|
336
|
349
|
#else
|
337
|
350
|
|
338
|
351
|
#define LCD_PINS_RS PA8
|
|
@@ -340,17 +353,17 @@
|
340
|
353
|
#define BTN_EN1 PD10
|
341
|
354
|
#define BTN_EN2 PH10
|
342
|
355
|
|
343
|
|
- #if DISABLED(CUSTOM_SPI_PINS)
|
344
|
|
- #define SD_DETECT_PIN PB10
|
345
|
|
- #define LCD_SDSS PB12
|
346
|
|
- #endif
|
347
|
|
-
|
348
|
356
|
#define LCD_PINS_ENABLE PC10
|
349
|
357
|
#define LCD_PINS_D4 PG8
|
350
|
358
|
|
351
|
359
|
#if ENABLED(FYSETC_MINI_12864)
|
352
|
360
|
#define DOGLCD_CS PC10
|
353
|
361
|
#define DOGLCD_A0 PA8
|
|
362
|
+
|
|
363
|
+ #if SD_CONNECTION_IS(ONBOARD)
|
|
364
|
+ #define SOFTWARE_SPI
|
|
365
|
+ #endif
|
|
366
|
+
|
354
|
367
|
//#define LCD_BACKLIGHT_PIN -1
|
355
|
368
|
#define LCD_RESET_PIN PG8 // Must be high or open for LCD to operate normally.
|
356
|
369
|
#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
|
|
@@ -389,11 +402,6 @@
|
389
|
402
|
#endif
|
390
|
403
|
#endif
|
391
|
404
|
|
392
|
|
- //#define DOGLCD_CS PB12
|
393
|
|
- //#define DOGLCD_A0 PA8
|
394
|
|
- //#define LCD_PINS_DC PB14
|
395
|
|
- //#define DOGLCD_MOSI PB15
|
396
|
|
-
|
397
|
405
|
#endif // HAS_SPI_LCD
|
398
|
406
|
|
399
|
407
|
#undef TP
|