Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» SDIO_SUPPORT => ONBOARD_SDIO
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Apr 23, 2023
1 parent 5664c02 commit 921591d
Show file tree
Hide file tree
Showing 35 changed files with 47 additions and 47 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/HAL/SAMD21/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
#error "EMERGENCY_PARSER is not yet implemented for SAMD21. Disable EMERGENCY_PARSER to continue."
#endif

#if ENABLED(SDIO_SUPPORT)
#error "SDIO_SUPPORT is not supported on SAMD21."
#if ENABLED(ONBOARD_SDIO)
#error "ONBOARD_SDIO is not supported on SAMD21."
#endif

#if ENABLED(FAST_PWM_FAN)
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/SAMD51/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
#error "EMERGENCY_PARSER is not yet implemented for SAMD51. Disable EMERGENCY_PARSER to continue."
#endif

#if ENABLED(SDIO_SUPPORT)
#error "SDIO_SUPPORT is not supported on SAMD51."
#if ENABLED(ONBOARD_SDIO)
#error "ONBOARD_SDIO is not supported on SAMD51."
#endif

#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void MarlinHAL::init() {
constexpr int cpuFreq = F_CPU;
UNUSED(cpuFreq);

#if HAS_MEDIA && DISABLED(SDIO_SUPPORT) && (defined(SDSS) && SDSS != -1)
#if HAS_MEDIA && DISABLED(ONBOARD_SDIO) && (defined(SDSS) && SDSS != -1)
OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
#endif

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/STM32/sdio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "../../inc/MarlinConfig.h"

#if ENABLED(SDIO_SUPPORT)
#if ENABLED(ONBOARD_SDIO)

#include "sdio.h"

Expand Down Expand Up @@ -453,5 +453,5 @@ uint32_t SDIO_GetCardSize() {
return (uint32_t)(hsd.SdCard.BlockNbr) * (hsd.SdCard.BlockSize);
}

#endif // SDIO_SUPPORT
#endif // ONBOARD_SDIO
#endif // HAL_STM32
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32F1/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@

// Allow for no media drives
#if !HAS_MEDIA
#undef SDIO_SUPPORT
#undef ONBOARD_SDIO
#endif
2 changes: 1 addition & 1 deletion Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@
#endif

#if DISABLED(USB_FLASH_DRIVE_SUPPORT) || BOTH(MULTI_VOLUME, VOLUME_SD_ONBOARD)
#if ENABLED(SDIO_SUPPORT)
#if ENABLED(ONBOARD_SDIO)
#define NEED_SD2CARD_SDIO 1
#else
#define NEED_SD2CARD_SPI 1
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/pins/gd32f1/pins_TRIGORILLA_V006.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@
//
#define SD_DETECT_PIN PC7

#ifndef SDIO_SUPPORT
#define SDIO_SUPPORT
#ifndef ONBOARD_SDIO
#define ONBOARD_SDIO
#endif
#if ENABLED(SDIO_SUPPORT)
#if ENABLED(ONBOARD_SDIO)
//
// SPI
//
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_CHITU3D_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
//
// SD Card
//
#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define SD_DETECT_PIN -1 // PF0, but it isn't connected
#define SDIO_CLOCK 4500000
#define SDIO_READ_RETRIES 16
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
#define SDCARD_CONNECTION ONBOARD
#define ON_BOARD_SPI_DEVICE 1
#define ONBOARD_SD_CS_PIN PC12 // SDSS
#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer

//
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_CREALITY_V4.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
//
#define SD_DETECT_PIN PC7
#define SDCARD_CONNECTION ONBOARD
#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer

#if ANY(RET6_12864_LCD, HAS_DWIN_E3V2, IS_DWIN_MARLINUI)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
#define SDCARD_CONNECTION ONBOARD
#define ONBOARD_SPI_DEVICE 1
#define ONBOARD_SD_CS_PIN PA4 // SDSS
#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer

#if ANY(RET6_12864_LCD, HAS_DWIN_E3V2, IS_DWIN_MARLINUI)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
#define SD_DETECT_PIN PC7
#define NO_SD_HOST_DRIVE // SD is only seen by the printer

#define SDIO_SUPPORT // Extra added by Creality
#define ONBOARD_SDIO // Extra added by Creality
#define SDIO_CLOCK 6000000 // In original source code overridden by Creality in sdio.h

//
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_CREALITY_V521.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
#define SDCARD_CONNECTION ONBOARD
#define ONBOARD_SPI_DEVICE 1
#define ONBOARD_SD_CS_PIN PC11 // SDSS
#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer

#if ANY(RET6_12864_LCD, HAS_DWIN_E3V2, IS_DWIN_MARLINUI)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
#define SD_SS_PIN -1
#define SD_DETECT_PIN PD12 // SD_CD (if -1 no detection)
#else
#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define SDIO_CLOCK 4500000 // 4.5 MHz
#define SDIO_READ_RETRIES 16
#define ONBOARD_SPI_DEVICE 1 // SPI1
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
#define LCD_BRIGHTNESS_DEFAULT TFT_BACKLIGHT_PWM
#endif

#if ENABLED(SDIO_SUPPORT)
#if ENABLED(ONBOARD_SDIO)
#define SD_SS_PIN -1 // else SDSS set to PA4 in M43 (spi_pins.h)
#endif

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
#define SDCARD_CONNECTION ONBOARD
#endif

#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define SDIO_CLOCK 4500000 // 4.5 MHz
#define SDIO_READ_RETRIES 16

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@
// SPI1(PA7) & SPI3(PB5) not available
#define SPI_DEVICE 2

#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define SDIO_CLOCK 4500000
#define SDIO_READ_RETRIES 16
#if ENABLED(SDIO_SUPPORT)
#if ENABLED(ONBOARD_SDIO)
#define SD_SCK_PIN PB13 // SPI2
#define SD_MISO_PIN PB14 // SPI2
#define SD_MOSI_PIN PB15 // SPI2
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
#endif

#if SD_CONNECTION_IS(ONBOARD)
#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define SDIO_CLOCK 4500000 // 4.5 MHz
#define SD_DETECT_PIN PD12
#define ONBOARD_SD_CS_PIN PC11
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
#define SDCARD_CONNECTION ONBOARD
#endif

#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define SDIO_CLOCK 4500000 // 4.5 MHz
#define SD_DETECT_PIN PD12
#define ONBOARD_SPI_DEVICE 1 // SPI1
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
#endif

#if SD_CONNECTION_IS(ONBOARD)
#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define SDIO_CLOCK 4500000 // 4.5 MHz
#define SD_DETECT_PIN PD12
#define ONBOARD_SD_CS_PIN PC11
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
#define SDCARD_CONNECTION ONBOARD
#endif

#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define SDIO_CLOCK 4500000 // 4.5 MHz
#define SD_DETECT_PIN PD12
#define ONBOARD_SD_CS_PIN PC11
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
#define SD_MOSI_PIN PB15
#define SD_SS_PIN PG6
#elif SD_CONNECTION_IS(ONBOARD)
#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define SD_DETECT_PIN PD12
#define ONBOARD_SD_CS_PIN PC11
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_SOVOL_V131.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
#define SDCARD_CONNECTION ONBOARD
#define ONBOARD_SPI_DEVICE 1
#define ONBOARD_SD_CS_PIN PA4 // SDSS
#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer

#if ANY(RET6_12864_LCD, HAS_DWIN_E3V2, IS_DWIN_MARLINUI)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
// SPI1(PA7) & SPI3(PB5) not available
#define SPI_DEVICE 2

#if ENABLED(SDIO_SUPPORT)
#if ENABLED(ONBOARD_SDIO)
#define SD_SCK_PIN PB13 // SPI2 ok
#define SD_MISO_PIN PB14 // SPI2 ok
#define SD_MOSI_PIN PB15 // SPI2 ok
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/stm32f4/pins_ANET_ET4.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@
//
// SD Card
//
//#define SDIO_SUPPORT
//#define ONBOARD_SDIO

#ifndef SDCARD_CONNECTION
#define SDCARD_CONNECTION CUSTOM_CABLE
#endif

#if HAS_MEDIA

#if DISABLED(SDIO_SUPPORT)
#if DISABLED(ONBOARD_SDIO)
#define SOFTWARE_SPI
#define SDSS PC11
#define SD_SS_PIN SDSS
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@
#endif

#if SD_CONNECTION_IS(ONBOARD)
#define SDIO_SUPPORT // Use SDIO for onboard SD
#if DISABLED(SDIO_SUPPORT)
#define ONBOARD_SDIO // Use SDIO for onboard SD
#if DISABLED(ONBOARD_SDIO)
#define SOFTWARE_SPI // Use soft SPI for onboard SD
#define SDSS PC11
#define SD_SCK_PIN PC12
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
#endif

#if SD_CONNECTION_IS(ONBOARD)
#define SDIO_SUPPORT // Use SDIO for onboard SD
#define ONBOARD_SDIO // Use SDIO for onboard SD
//#define SDIO_CLOCK 48000000
#define SD_DETECT_PIN PC4
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
// Must use soft SPI because Marlin's default hardware SPI is tied to LCD's EXP2
//
#if SD_CONNECTION_IS(ONBOARD)
#define SDIO_SUPPORT // Use SDIO for onboard SD
#define ONBOARD_SDIO // Use SDIO for onboard SD
#ifndef SD_DETECT_STATE
#define SD_DETECT_STATE HIGH
#elif SD_DETECT_STATE == LOW
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@
#define SD_MOSI_PIN EXP2_06_PIN
#define SD_DETECT_PIN EXP2_07_PIN
#elif SD_CONNECTION_IS(ONBOARD)
#define SDIO_SUPPORT // Use SDIO for onboard SD
#define ONBOARD_SDIO // Use SDIO for onboard SD
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
#error "No custom SD drive cable defined for this board."
#endif
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/stm32f4/pins_FLYF407ZG.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@

#if SD_CONNECTION_IS(ONBOARD)

#define SDIO_SUPPORT // Use SDIO for onboard SD
#define ONBOARD_SDIO // Use SDIO for onboard SD

#if DISABLED(SDIO_SUPPORT)
#if DISABLED(ONBOARD_SDIO)
#define SOFTWARE_SPI // Use soft SPI for onboard SD
#define SDSS PC11
#define SD_SCK_PIN PC12
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/stm32f4/pins_LERDGE_K.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,10 @@
//
// SD support
//
#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define SDIO_CLOCK 4800000
#define SD_DETECT_PIN PA8
#if DISABLED(SDIO_SUPPORT)
#if DISABLED(ONBOARD_SDIO)
#define SOFTWARE_SPI
#define SD_SCK_PIN PC12
#define SD_MISO_PIN PC8
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/stm32f4/pins_LERDGE_S.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@
//
// SD support
//
#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define SDIO_CLOCK 4800000
#define SD_DETECT_PIN PG15
#if DISABLED(SDIO_SUPPORT)
#if DISABLED(ONBOARD_SDIO)
#define SOFTWARE_SPI
#define SD_SCK_PIN PC12
#define SD_MISO_PIN PC8
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/stm32f4/pins_LERDGE_X.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@
//
// SD support (On board)
//
#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define SD_DETECT_PIN PA8
#define SDIO_CLOCK 4800000
#if DISABLED(SDIO_SUPPORT)
#if DISABLED(ONBOARD_SDIO)
#define SOFTWARE_SPI
#define SD_SCK_PIN PC12
#define SD_MISO_PIN PC8
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f4/pins_TRONXY_V10.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
//
// SD Card
//
#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define SD_DETECT_PIN -1 // PF0, but not connected
#define SDIO_CLOCK 4500000
#define SDIO_READ_RETRIES 16
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@
#define SD_MOSI_PIN EXP2_06_PIN
#define SD_DETECT_PIN EXP2_07_PIN
#elif SD_CONNECTION_IS(ONBOARD)
#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define SDIO_CLOCK 24000000 // 24MHz
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
#error "No custom SD drive cable defined for this board."
Expand Down

0 comments on commit 921591d

Please sign in to comment.