提交 2aed417d 编写于 作者: M me-no-dev

Enable 1bit SDMMC for Olimex ESP32-EVB

Fixes:
https://github.com/espressif/arduino-esp32/issues/495#issuecomment-31604
2612
上级 91d02cc6
......@@ -34,7 +34,7 @@ SDMMCFS::SDMMCFS(FSImplPtr impl)
: FS(impl), _card(NULL)
{}
bool SDMMCFS::begin(const char * mountpoint)
bool SDMMCFS::begin(const char * mountpoint, bool mode1bit)
{
if(_card) {
return true;
......@@ -43,7 +43,12 @@ bool SDMMCFS::begin(const char * mountpoint)
sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT();
sdmmc_host_t host = SDMMC_HOST_DEFAULT();
host.max_freq_khz = SDMMC_FREQ_HIGHSPEED;
//host.flags = SDMMC_HOST_FLAG_1BIT; //use 1-line SD mode
#ifdef BOARD_HAS_1BIT_SDMMC
mode1bit = true;
#endif
if(mode1bit) {
host.flags = SDMMC_HOST_FLAG_1BIT; //use 1-line SD mode
}
esp_vfs_fat_sdmmc_mount_config_t mount_config = {
.format_if_mount_failed = false,
......
......@@ -28,7 +28,7 @@ protected:
public:
SDMMCFS(FSImplPtr impl);
bool begin(const char * mountpoint="/sdcard");
bool begin(const char * mountpoint="/sdcard", bool mode1bit=false);
void end();
sdcard_type_t cardType();
uint64_t cardSize();
......
......@@ -25,4 +25,6 @@ static const uint8_t MOSI = 2;
static const uint8_t MISO = 15;
static const uint8_t SCK = 14;
#define BOARD_HAS_1BIT_SDMMC
#endif /* Pins_Arduino_h */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册