Skip to content

Commit

Permalink
Merge pull request #457 from marivaaldo/feature/fix-m5stickcplus-sdcard
Browse files Browse the repository at this point in the history
Fix SDInterface on M5StickCPlus
  • Loading branch information
justcallmekoko authored Jan 17, 2024
2 parents f8a831f + ad3cf7e commit 28c037a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions esp32_marauder/SDInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions esp32_marauder/SDInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ extern Settings settings_obj;
class SDInterface {

private:
#if defined(MARAUDER_M5STICKC)
SPIClass *spiExt;
#endif
bool checkDetectPin();

public:
Expand Down

0 comments on commit 28c037a

Please sign in to comment.