sdcard fix

This commit is contained in:
Klaus K Wilting 2020-05-16 18:01:00 +02:00
parent 011dc171c1
commit 10616ffc52
2 changed files with 3 additions and 3 deletions

View File

@ -207,9 +207,9 @@ There in the sensor configuration select "TheThingsNetwork" and set Decoding Pro
# SD-card # SD-card
Data can be stored on an SD-card if one is availabe. Simply choose the file in src/hal and add the following lines to your hal-file: Data can be stored on an SD-card if one is availabe. Simply choose the file in src/hal and add the following lines to your hal-file:
#define HAS_SDCARD 1 // this board has an SD-card-reader/writer, with SPI interface #define HAS_SDCARD 1 // SD-card-reader/writer, using SPI interface
OR OR
#define HAS_SDCARD 2 // this board has an SD-card-reader/writer, using native SD interface #define HAS_SDCARD 2 // SD-card-reader/writer, using SDMMC interface
// Pins for SD-card // Pins for SD-card
#define SDCARD_CS (13) // fill in the correct numbers for your board #define SDCARD_CS (13) // fill in the correct numbers for your board

View File

@ -16,7 +16,7 @@ File fileSDCard;
bool sdcard_init() { bool sdcard_init() {
ESP_LOGI(TAG, "looking for SD-card..."); ESP_LOGI(TAG, "looking for SD-card...");
#if HAS_SDCARD == 1 #if HAS_SDCARD == 1
pinMode(SS, OUTPUT); pinMode(SDCARD_CS, OUTPUT);
useSDCard = SD.begin(SDCARD_CS, SDCARD_MOSI, SDCARD_MISO, SDCARD_SCLK); useSDCard = SD.begin(SDCARD_CS, SDCARD_MOSI, SDCARD_MISO, SDCARD_SCLK);
#elif HAS_SDCARD == 2 #elif HAS_SDCARD == 2
useSDCard = SD_MMC.begin(); useSDCard = SD_MMC.begin();