8000 fix sdmmc config · sdaitzman/arduino-esp32@d5e8ad0 · GitHub
[go: up one dir, main page]

Skip to content

Commit d5e8ad0

Browse files
committed
fix sdmmc config
1 parent 1424b6d commit d5e8ad0

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

libraries/SD_MMC/src/SD_MMC.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,21 @@ bool SDMMCFS::begin(const char * mountpoint, bool mode1bit)
4242
}
4343
//mount
4444
sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT();
45-
sdmmc_host_t host = SDMMC_HOST_DEFAULT();
45+
sdmmc_host_t host = {
46+
.flags = SDMMC_HOST_FLAG_4BIT,
47+
.slot = SDMMC_HOST_SLOT_1,
48+
.max_freq_khz = SDMMC_FREQ_DEFAULT,
49+
.io_voltage = 3.3f,
50+
.init = &sdmmc_host_init,
51+
.set_bus_width = &sdmmc_host_set_bus_width,
52+
.get_bus_width = &sdmmc_host_get_slot_width,
53+
.set_card_clk = &sdmmc_host_set_card_clk,
54+
.do_transaction = &sdmmc_host_do_transaction,
55+
.deinit = &sdmmc_host_deinit,
56+
.io_int_enable = sdmmc_host_io_int_enable,
57+
.io_int_wait = sdmmc_host_io_int_wait,
58+
.command_timeout_ms = 0,
59+
};
4660
host.max_freq_khz = SDMMC_FREQ_HIGHSPEED;
4761
#ifdef BOARD_HAS_1BIT_SDMMC
4862
mode1bit = true;
@@ -53,7 +67,8 @@ bool SDMMCFS::begin(const char * mountpoint, bool mode1bit)
5367

5468
esp_vfs_fat_sdmmc_mount_config_t mount_config = {
5569
.format_if_mount_failed = false,
56-
.max_files = 5
70+
.max_files = 5,
71+
.allocation_unit_size = 0
5772
};
5873

5974
esp_err_t ret = esp_vfs_fat_sdmmc_mount(mountpoint, &host, &slot_config, &mount_config, &_card);

0 commit comments

Comments
 (0)
0