Skip to content

Commit 20b2cb9

Browse files
committed
Support fs lock
1 parent b5881ee commit 20b2cb9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+16
-9
lines changed

libraries/SD_MMC/src/SD_MMC.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ SDMMCFS::SDMMCFS(FSImplPtr impl)
3636
: FS(impl), _card(NULL)
3737
{}
3838

39-
bool SDMMCFS::begin(const char * mountpoint, bool mode1bit, bool format_if_mount_failed, int maxOpenFiles)
39+
bool SDMMCFS::begin(const char * mountpoint, bool mode1bit, bool format_if_mount_failed, int sdmmc_frequency, int maxOpenFiles)
4040
{
4141
if(_card) {
4242
return true;
@@ -59,7 +59,7 @@ bool SDMMCFS::begin(const char * mountpoint, bool mode1bit, bool format_if_mount
5959
.io_int_wait = &sdmmc_host_io_int_wait,
6060
.command_timeout_ms = 0
6161
};
62-
host.max_freq_khz = SDMMC_FREQ_HIGHSPEED;
62+
host.max_freq_khz = sdmmc_frequency;
6363
#ifdef BOARD_HAS_1BIT_SDMMC
6464
mode1bit = true;
6565
#endif

libraries/SD_MMC/src/SD_MMC.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
#include "driver/sdmmc_types.h"
1919
#include "sd_defines.h"
2020

21+
// If reading/writing to the SD card is unstable,
22+
// you can define BOARD_MAX_SDMMC_FREQ with lower value (Ex. SDMMC_FREQ_DEFAULT)
23+
// in pins_arduino.h for your board variant.
24+
#ifndef BOARD_MAX_SDMMC_FREQ
25+
#define BOARD_MAX_SDMMC_FREQ SDMMC_FREQ_HIGHSPEED
26+
#endif
27+
2128
#ifndef SDMMC_HOST_MAX_FILES_DEFAULT
2229
#define SDMMC_HOST_MAX_FILES_DEFAULT 10
2330
#endif
@@ -32,7 +39,7 @@ class SDMMCFS : public FS
3239

3340
public:
3441
SDMMCFS(FSImplPtr impl);
35-
bool begin(const char *mountpoint = "/sdcard", bool mode1bit = false, bool format_if_mount_failed = false, int maxOpenFiles = SDMMC_HOST_MAX_FILES_DEFAULT);
42+
bool begin(const char *mountpoint = "/sdcard", bool mode1bit = false, bool format_if_mount_failed = false, int sdmmc_frequency = BOARD_MAX_SDMMC_FREQ, int maxOpenFiles = SDMMC_HOST_MAX_FILES_DEFAULT);
3643
void end();
3744
sdcard_type_t cardType();
3845
uint64_t cardSize();

tools/sdk/include/config/sdkconfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
#define CONFIG_APP_COMPILE_TIME_DATE 1
7373
#define CONFIG_CXX_EXCEPTIONS 1
7474
#define CONFIG_D2WD_PSRAM_CLK_IO 9
75-
#define CONFIG_FATFS_FS_LOCK 0
75+
#define CONFIG_FATFS_FS_LOCK 10
7676
#define CONFIG_IP_LOST_TIMER_INTERVAL 120
7777
#define CONFIG_SPIFFS_META_LENGTH 4
7878
#define CONFIG_ESP32_PANIC_PRINT_REBOOT 1
@@ -171,7 +171,7 @@
171171
#define CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT 1
172172
#define CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE 0
173173
#define CONFIG_MAKE_WARN_UNDEFINED_VARIABLES 1
174-
#define CONFIG_FATFS_TIMEOUT_MS 10000
174+
#define CONFIG_FATFS_TIMEOUT_MS 1000
175175
#define CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM 32
176176
#define CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS 1
177177
#define CONFIG_MBEDTLS_CCM_C 1

tools/sdk/ld/esp32.project.ld

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

tools/sdk/lib/libapp_trace.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libapp_update.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libasio.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libbootloader_support.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libbt.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libcoap.a

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)