Browse Source

🩹 Fix Maple HAL compile errors (#23685)

InsanityAutomation 2 years ago
parent
commit
3e93def08e
No account linked to committer's email address
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      Marlin/src/HAL/STM32F1/onboard_sd.cpp

+ 7
- 2
Marlin/src/HAL/STM32F1/onboard_sd.cpp View File

@@ -38,8 +38,13 @@
38 38
   #define SPI_CLOCK_MAX SPI_BAUD_PCLK_DIV_2
39 39
 #endif
40 40
 
41
-#define CS_LOW()  WRITE(ONBOARD_SD_CS_PIN, LOW)  // Set OnboardSPI cs low
42
-#define CS_HIGH() WRITE(ONBOARD_SD_CS_PIN, HIGH) // Set OnboardSPI cs high
41
+#if PIN_EXISTS(ONBOARD_SD_CS) && ONBOARD_SD_CS_PIN != SD_SS_PIN
42
+  #define CS_LOW()  WRITE(ONBOARD_SD_CS_PIN, LOW)  // Set OnboardSPI cs low
43
+  #define CS_HIGH() WRITE(ONBOARD_SD_CS_PIN, HIGH) // Set OnboardSPI cs high
44
+#else
45
+  #define CS_LOW()
46
+  #define CS_HIGH()
47
+#endif
43 48
 
44 49
 #define FCLK_FAST() ONBOARD_SD_SPI.setClockDivider(SPI_CLOCK_MAX)
45 50
 #define FCLK_SLOW() ONBOARD_SD_SPI.setClockDivider(SPI_BAUD_PCLK_DIV_256)

Loading…
Cancel
Save