From dc8d8cb39c3c5b66bab9bfbd2fe499706c91d2d6 Mon Sep 17 00:00:00 2001 From: thisiskeithb <13375512+thisiskeithb@users.noreply.github.com> Date: Sun, 15 Dec 2019 09:25:07 -0800 Subject: [PATCH] Fix MKS SGen-L SD detect pin (#16224) --- Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index 8d4adca34b..6d8e340f5f 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -208,7 +208,6 @@ #define BTN_EN2 P3_26 #define LCD_SDSS P0_28 - #define SD_DETECT_PIN P0_27 #if ENABLED(MKS_12864OLED_SSD1306) @@ -284,17 +283,16 @@ #define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card -#if SD_CONNECTION_IS(LCD) - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN P0_28 -#elif SD_CONNECTION_IS(ONBOARD) +#if SD_CONNECTION_IS(LCD) || SD_CONNECTION_IS(ONBOARD) #define SD_DETECT_PIN P0_27 #define SCK_PIN P0_07 #define MISO_PIN P0_08 #define MOSI_PIN P0_09 - #define SS_PIN ONBOARD_SD_CS_PIN + #if SD_CONNECTION_IS(ONBOARD) + #define SS_PIN ONBOARD_SD_CS_PIN + #else + #define SS_PIN P0_28 + #endif #elif SD_CONNECTION_IS(CUSTOM_CABLE) #error "No custom SD drive cable defined for this board." #endif