From 7f244f9b9cdce9580af6ee2a1926131805977364 Mon Sep 17 00:00:00 2001
From: luxflow <luxflow@live.com>
Date: Fri, 4 Jan 2019 01:44:00 +0900
Subject: [PATCH] Update LPC SD pins for BIQU SKR (#12767)

(Exactly matching the Azteeg X5 MINI Wifi)
---
 Marlin/src/pins/pins_BIQU_SKR_V1.1.h | 35 ++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/Marlin/src/pins/pins_BIQU_SKR_V1.1.h b/Marlin/src/pins/pins_BIQU_SKR_V1.1.h
index 6a2ce222b67..3ff9d1b21b7 100644
--- a/Marlin/src/pins/pins_BIQU_SKR_V1.1.h
+++ b/Marlin/src/pins/pins_BIQU_SKR_V1.1.h
@@ -196,3 +196,38 @@
   #endif
 
 #endif // ULTRA_LCD
+
+//
+// SD Support (as with the AZTEEG_X5_MINI_WIFI)
+//
+//#define USB_SD_DISABLED     // Disable host access to SD card as mass storage device through USB
+#define USB_SD_ONBOARD        // Enable host access to SD card as mass storage device through USB
+
+//#define LPC_SD_LCD          // Marlin uses the SD drive attached to the LCD
+#define LPC_SD_ONBOARD        // Marlin uses the SD drive on the control board.  There is no SD detect pin
+                              // for the onboard card.  Init card from LCD menu or send M21 whenever printer
+                              // is powered on to enable SD access.
+
+#if ENABLED(LPC_SD_LCD)
+
+  #define SCK_PIN            P0_15
+  #define MISO_PIN           P0_17
+  #define MOSI_PIN           P0_18
+  #define SS_PIN             P1_23   // Chip select for SD card used by Marlin
+  #define ONBOARD_SD_CS      P0_06   // Chip select for "System" SD card
+
+#elif ENABLED(LPC_SD_ONBOARD)
+
+  #if ENABLED(USB_SD_ONBOARD)
+    // When sharing the SD card with a PC we want the menu options to
+    // mount/unmount the card and refresh it. So we disable card detect.
+    #define SHARED_SD_CARD
+    #undef SD_DETECT_PIN // there is also no detect pin for the onboard card
+  #endif
+  #define SCK_PIN            P0_07
+  #define MISO_PIN           P0_08
+  #define MOSI_PIN           P0_09
+  #define SS_PIN             P0_06   // Chip select for SD card used by Marlin
+  #define ONBOARD_SD_CS      P0_06   // Chip select for "System" SD card
+
+#endif