From ad3cf7ec7e40bb0e501d0fbad5134d5739e06b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marivaldo=20J=C3=BAnior?= Date: Wed, 3 Jan 2024 12:40:54 -0300 Subject: [PATCH] fix m5stickcplus sdinterface --- esp32_marauder/SDInterface.cpp | 6 +++--- esp32_marauder/SDInterface.h | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/esp32_marauder/SDInterface.cpp b/esp32_marauder/SDInterface.cpp index 1ca4b3f..ca57532 100644 --- a/esp32_marauder/SDInterface.cpp +++ b/esp32_marauder/SDInterface.cpp @@ -32,9 +32,9 @@ bool SDInterface::initSD() { - CS (jumper to SD Card GND Pin) */ enum { SPI_SCK = 0, SPI_MISO = 36, SPI_MOSI = 26 }; - SPIClass SPI_EXT; - SPI_EXT.begin(SPI_SCK, SPI_MISO, SPI_MOSI, SD_CS); - if (!SD.begin(SD_CS, SPI_EXT)) { + this->spiExt = new SPIClass(); + this->spiExt->begin(SPI_SCK, SPI_MISO, SPI_MOSI, SD_CS); + if (!SD.begin(SD_CS, *(this->spiExt))) { #else if (!SD.begin(SD_CS)) { #endif diff --git a/esp32_marauder/SDInterface.h b/esp32_marauder/SDInterface.h index e29e62b..8f3026a 100644 --- a/esp32_marauder/SDInterface.h +++ b/esp32_marauder/SDInterface.h @@ -26,6 +26,9 @@ extern Settings settings_obj; class SDInterface { private: +#if defined(MARAUDER_M5STICKC) + SPIClass *spiExt; +#endif bool checkDetectPin(); public: