From 6c24aea7e45106641ab859da3b8bd8c2b51e85e1 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Sat, 6 Jun 2020 21:15:31 +0200 Subject: [PATCH 1/2] sdcard.cpp edits --- include/sdcard.h | 1 + src/sdcard.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/sdcard.h b/include/sdcard.h index 7102c460..e6bc62fb 100644 --- a/include/sdcard.h +++ b/include/sdcard.h @@ -8,6 +8,7 @@ #ifdef HAS_SDCARD #if HAS_SDCARD == 1 #include +//#include #elif HAS_SDCARD == 2 #include #else diff --git a/src/sdcard.cpp b/src/sdcard.cpp index 5047ee2e..94e14eaa 100644 --- a/src/sdcard.cpp +++ b/src/sdcard.cpp @@ -19,7 +19,13 @@ bool sdcard_init() { // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/sdmmc_host.html #if HAS_SDCARD == 1 // use SD SPI host driver + useSDCard = SD.begin(SDCARD_CS, SDCARD_MOSI, SDCARD_MISO, SDCARD_SCLK); + + //SPI.begin(SDCARD_SCLK, SDCARD_MSO, SDCARD_MOSI, SDCARD_CS); + //delay(10); + //useSDCard = SD.begin(SDCARD_CS, SPI, 40000000, "/sd"); + #elif HAS_SDCARD == 2 // use SD MMC host driver useSDCard = SD_MMC.begin(); #endif From 7f16cd430c9ff6c742cf98eb4ff87d2e4c50c392 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Sat, 6 Jun 2020 21:16:04 +0200 Subject: [PATCH 2/2] ttgov21new.h: change SD interface SPI -> SDMMC --- src/hal/ttgov21new.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/hal/ttgov21new.h b/src/hal/ttgov21new.h index 309acd2d..ca2a9cc6 100644 --- a/src/hal/ttgov21new.h +++ b/src/hal/ttgov21new.h @@ -16,12 +16,7 @@ #define CFG_sx1276_radio 1 // HPD13A LoRa SoC // enable only if you want to store a local paxcount table on the device -#define HAS_SDCARD 1 // this board has an SD-card-reader/writer -// Pins for SD-card -#define SDCARD_CS (13) -#define SDCARD_MOSI (15) -#define SDCARD_MISO (2) -#define SDCARD_SCLK (14) +#define HAS_SDCARD 2 // this board has an SD-card-reader/writer #define HAS_DISPLAY 1 #define HAS_LED (25) // green on board LED