make SD SPI configurable

This commit is contained in:
Tobias Gunkel
2025-08-24 12:29:44 +02:00
parent f3125a2b0b
commit b3b74fd922
3 changed files with 29 additions and 28 deletions
+4 -4
View File
@@ -34,10 +34,10 @@ gpio_function_t UseSDPinFunctionScope::sd_mosi_pin_func = GPIO_FUNC_NULL;
bool init_sdcard_hardware() {
auto scope = UseSDPinFunctionScope();
SPI.setMISO(SD_MISO_PIN);
SPI.setMOSI(SD_MOSI_PIN);
SPI.setSCK(SD_SCK_PIN);
bool success = sd.begin(SdSpiConfig(SD_CS_PIN, SHARED_SPI, SD_SCK_MHZ(50), &SPI));
SD_SPI.setMISO(SD_MISO_PIN);
SD_SPI.setMOSI(SD_MOSI_PIN);
SD_SPI.setSCK(SD_SCK_PIN);
bool success = sd.begin(SdSpiConfig(SD_CS_PIN, SHARED_SPI, SD_SCK_MHZ(50), &SD_SPI));
if (success) {
UseSDPinFunctionScope::init();
}