From b2fd631d82b9b3e64226ceac6a132ec917aaee21 Mon Sep 17 00:00:00 2001 From: Robherc <68039049+robherc@users.noreply.github.com> Date: Fri, 12 Jan 2024 23:03:34 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Fix=20SD=20connection=20defaults?= =?UTF-8?q?=20(#26666)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: thisiskeithb <13375512+thisiskeithb@users.noreply.github.com> Co-authored-by: Scott Lahteine --- Marlin/src/inc/Conditionals_LCD.h | 2 ++ Marlin/src/inc/SanityCheck.h | 4 ++-- Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h | 2 +- Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h | 2 +- Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h | 6 +++++- Marlin/src/pins/stm32f1/pins_MD_D301.h | 4 ++-- Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h | 2 +- Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h | 6 +++++- Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_common.h | 2 +- Marlin/src/pins/stm32h7/pins_BTT_KRAKEN_V1_0.h | 2 +- Marlin/src/pins/stm32h7/pins_BTT_MANTA_M8P_V2_0.h | 2 +- Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h | 2 +- Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_PRO_V1_common.h | 2 +- 13 files changed, 24 insertions(+), 14 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 58842209afe2..729f450147e3 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -784,6 +784,7 @@ #elif ENABLED(CR10_STOCKDISPLAY) #define IS_RRD_FG_SC 1 + #define NO_LCD_SDCARD #define LCD_ST7920_DELAY_1 125 #define LCD_ST7920_DELAY_2 125 #define LCD_ST7920_DELAY_3 125 @@ -1684,6 +1685,7 @@ #define TFT_DEFAULT_ORIENTATION TFT_EXCHANGE_XY #define TFT_RES_480x320 #define TFT_INTERFACE_SPI + #define NO_LCD_SDCARD #elif ANY(LERDGE_TFT35, ANET_ET5_TFT35) // ST7796 #define TFT_DEFAULT_ORIENTATION TFT_EXCHANGE_XY #define TFT_RES_480x320 diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index bab6fa1d0193..a60ead1d08e4 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2705,8 +2705,8 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_2), "zh_CN") == 0, "LCD_LANGUAGE_2 must be set to zh_CN for ANYCUBIC_LCD_VYPER."); #endif -#if ANY(MKS_TS35_V2_0, BTT_TFT35_SPI_V1_0) && SD_CONNECTION_IS(LCD) - #error "SDCARD_CONNECTION cannot be set to LCD for the enabled TFT. No available SD card reader." +#if ENABLED(NO_LCD_SDCARD) && SD_CONNECTION_IS(LCD) + #error "SDCARD_CONNECTION cannot be set to LCD for the enabled display. No available SD card reader." #endif /** diff --git a/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h b/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h index ca8010493bb9..569c9781d270 100644 --- a/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h +++ b/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h @@ -96,7 +96,7 @@ #define BTN_EN1 P4_28 #define BTN_EN2 P1_27 #define BTN_ENC P3_26 - #ifndef SDCARD_CONNECTION + #if !defined(SDCARD_CONNECTION) && DISABLED(NO_LCD_SDCARD) #define SDCARD_CONNECTION LCD #endif #endif diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h index 75eea8e0f6ca..ee3934a4ef2d 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h @@ -119,7 +119,7 @@ // SD Support // #ifndef SDCARD_CONNECTION - #if HAS_WIRED_LCD + #if HAS_WIRED_LCD && DISABLED(NO_LCD_SDCARD) #define SDCARD_CONNECTION LCD #else #define SDCARD_CONNECTION ONBOARD diff --git a/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h b/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h index a9184073c5d6..7aa4aa642349 100644 --- a/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h +++ b/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h @@ -160,7 +160,11 @@ // #ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION LCD + #if ENABLED(NO_LCD_SDCARD) + #define SDCARD_CONNECTION ONBOARD + #else + #define SDCARD_CONNECTION LCD + #endif #endif #if SD_CONNECTION_IS(LCD) diff --git a/Marlin/src/pins/stm32f1/pins_MD_D301.h b/Marlin/src/pins/stm32f1/pins_MD_D301.h index 5724879badec..bcede1d4be9c 100644 --- a/Marlin/src/pins/stm32f1/pins_MD_D301.h +++ b/Marlin/src/pins/stm32f1/pins_MD_D301.h @@ -160,8 +160,8 @@ // // SD Support // -#ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION LCD +#if !defined(SDCARD_CONNECTION) && DISABLED(NO_LCD_SDCARD) + #define SDCARD_CONNECTION LCD #endif #define SD_DETECT_PIN PE3 diff --git a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h index f88c75a27dd5..855e94c72dc3 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h @@ -235,7 +235,7 @@ // SD Support // #ifndef SDCARD_CONNECTION - #if HAS_WIRED_LCD + #if HAS_WIRED_LCD && DISABLED(NO_LCD_SDCARD) #define SDCARD_CONNECTION LCD #else #define SDCARD_CONNECTION ONBOARD diff --git a/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h b/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h index 42ee66caace7..3ff29e6862d4 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h @@ -250,7 +250,11 @@ // #if HAS_MEDIA #ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION LCD + #if ENABLED(NO_LCD_SDCARD) + #define SDCARD_CONNECTION ONBOARD + #else + #define SDCARD_CONNECTION LCD + #endif #endif #if SD_CONNECTION_IS(ONBOARD) //#define SOFTWARE_SPI diff --git a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_common.h b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_common.h index fc3f679b8d18..796527b364d5 100644 --- a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_common.h +++ b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_common.h @@ -228,7 +228,7 @@ // SD Support // #ifndef SDCARD_CONNECTION - #if HAS_WIRED_LCD + #if HAS_WIRED_LCD && DISABLED(NO_LCD_SDCARD) #define SDCARD_CONNECTION LCD #else #define SDCARD_CONNECTION ONBOARD diff --git a/Marlin/src/pins/stm32h7/pins_BTT_KRAKEN_V1_0.h b/Marlin/src/pins/stm32h7/pins_BTT_KRAKEN_V1_0.h index ad24d902f92e..d55e0a3f84f8 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_KRAKEN_V1_0.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_KRAKEN_V1_0.h @@ -326,7 +326,7 @@ // SD Support // #ifndef SDCARD_CONNECTION - #if HAS_WIRED_LCD + #if HAS_WIRED_LCD && DISABLED(NO_LCD_SDCARD) #define SDCARD_CONNECTION LCD #else #define SDCARD_CONNECTION ONBOARD diff --git a/Marlin/src/pins/stm32h7/pins_BTT_MANTA_M8P_V2_0.h b/Marlin/src/pins/stm32h7/pins_BTT_MANTA_M8P_V2_0.h index 346cd1c3481f..bc6118228ff8 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_MANTA_M8P_V2_0.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_MANTA_M8P_V2_0.h @@ -272,7 +272,7 @@ // SD Support // #ifndef SDCARD_CONNECTION - #if HAS_WIRED_LCD + #if HAS_WIRED_LCD && DISABLED(NO_LCD_SDCARD) #define SDCARD_CONNECTION LCD #else #define SDCARD_CONNECTION ONBOARD diff --git a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h index b0890036ee7b..6c081f9b56ee 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h @@ -254,7 +254,7 @@ // SD Support // #ifndef SDCARD_CONNECTION - #if HAS_WIRED_LCD + #if HAS_WIRED_LCD && DISABLED(NO_LCD_SDCARD) #define SDCARD_CONNECTION LCD #else #define SDCARD_CONNECTION ONBOARD diff --git a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_PRO_V1_common.h b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_PRO_V1_common.h index 43b3d6852237..148b21de0b3c 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_PRO_V1_common.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_PRO_V1_common.h @@ -246,7 +246,7 @@ // SD Support // #ifndef SDCARD_CONNECTION - #if HAS_WIRED_LCD + #if HAS_WIRED_LCD && DISABLED(NO_LCD_SDCARD) #define SDCARD_CONNECTION LCD #else #define SDCARD_CONNECTION ONBOARD