From 9f90e29270a4f00e4a3709c7ca45bae25e7baba2 Mon Sep 17 00:00:00 2001 From: Folkert van Heusden Date: Sat, 2 Nov 2024 22:24:08 +0100 Subject: [PATCH] ESP32-WT-ETH01 stability fix --- microcontrollers/backend-sdcard.cpp | 2 +- microcontrollers/backend-sdcard.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/microcontrollers/backend-sdcard.cpp b/microcontrollers/backend-sdcard.cpp index 74de4d3..ffed21b 100644 --- a/microcontrollers/backend-sdcard.cpp +++ b/microcontrollers/backend-sdcard.cpp @@ -64,7 +64,7 @@ bool backend_sdcard::reinit(const bool close_first) #if defined(WT_ETH01) for(int sp=22; sp>=14; sp -= 2) { Serial.printf("Trying %d MHz...\r\n", sp); - if (sd.begin(SdSpiConfig(pin_SD_CS, DEDICATED_SPI, SD_SCK_MHZ(sp)))) { + if (sd.begin(SdSpiConfig(pin_SD_CS, SHARED_SPI, SD_SCK_MHZ(sp)))) { ok = true; Serial.printf("Accessing SD card at %d MHz\r\n", sp); break; diff --git a/microcontrollers/backend-sdcard.h b/microcontrollers/backend-sdcard.h index b8d140a..ac31529 100644 --- a/microcontrollers/backend-sdcard.h +++ b/microcontrollers/backend-sdcard.h @@ -1,4 +1,7 @@ #include +#if defined(WT_ETH01) +#define SPI_DRIVER_SELECT 1 +#endif #include #include