diff --git a/src/sd.cpp b/src/sd.cpp index 9d8a816..d959521 100644 --- a/src/sd.cpp +++ b/src/sd.cpp @@ -347,7 +347,7 @@ start: } case 1: { - auto path = loopSD(SD_MMC); + auto path = loopSD(SD); if (path.equals("")) { redraw = true; diff --git a/src/sd.hpp b/src/sd.hpp index b9b1d90..ab0855d 100644 --- a/src/sd.hpp +++ b/src/sd.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include #define MAXFILES 256 diff --git a/src/t-hmi-c64/C64.cpp b/src/t-hmi-c64/C64.cpp index 5e65d60..934cff6 100644 --- a/src/t-hmi-c64/C64.cpp +++ b/src/t-hmi-c64/C64.cpp @@ -303,7 +303,7 @@ void loadFile(void *parameter) } else if (ext.compare(".prg") == 0) { - uint16_t addr = sdcard.loadFile(SD_MMC, path.c_str(), ram); + uint16_t addr = sdcard.loadFile(SD, path.c_str(), ram); if (sdcard.loadAddr == 0) { ESP_LOGI(TAG, "error loading file"); diff --git a/src/t-hmi-c64/SDCard.cpp b/src/t-hmi-c64/SDCard.cpp index 30ea731..462d26d 100644 --- a/src/t-hmi-c64/SDCard.cpp +++ b/src/t-hmi-c64/SDCard.cpp @@ -36,8 +36,8 @@ bool SDCard::init() vTaskDelay(500 / portTICK_PERIOD_MS); pinMode(PWR_EN_PIN, OUTPUT); digitalWrite(PWR_EN_PIN, HIGH); - SD_MMC.setPins(SD_SCLK_PIN, SD_MOSI_PIN, SD_MISO_PIN); - bool rlst = SD_MMC.begin("/sdcard", true); + SPI.begin(SD_SCLK_PIN, SD_MISO_PIN, SD_MOSI_PIN); + bool rlst = SD.begin(PWR_EN_PIN, SPI, 4000000, "/sdcard", 5, false); if (!rlst) { return false; diff --git a/src/t-hmi-c64/SDCard.h b/src/t-hmi-c64/SDCard.h index 0cfba2b..60cbb6e 100644 --- a/src/t-hmi-c64/SDCard.h +++ b/src/t-hmi-c64/SDCard.h @@ -18,6 +18,7 @@ #pragma once #include +#include #include #include