diff options
| author | Meco Jianting Man <[email protected]> | 2021-09-27 06:16:39 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-09-27 06:16:39 -0500 |
| commit | 37d4abb822c60872bf21f6a1bb0b61e8e1409cc7 (patch) | |
| tree | ac8e69dbd720d5ad50529a029ba81c9fc9e7d9f9 /components/dfs | |
| parent | 8e287cfdf70da52937eebe59a1e2527775dd1f0c (diff) | |
| parent | 94bd9f96a4b49e94916a2904eea882792e0460d2 (diff) | |
Merge branch 'master' into libc_stdio
Diffstat (limited to 'components/dfs')
| -rw-r--r-- | components/dfs/Kconfig | 6 | ||||
| -rw-r--r-- | components/dfs/filesystems/.ignore_format.yml | 4 | ||||
| -rw-r--r-- | components/dfs/filesystems/elmfat/dfs_elm.c | 4 | ||||
| -rw-r--r-- | components/dfs/filesystems/elmfat/ffconf.h | 6 | ||||
| -rw-r--r-- | components/dfs/src/dfs_select.c | 2 |
5 files changed, 18 insertions, 4 deletions
diff --git a/components/dfs/Kconfig b/components/dfs/Kconfig index 442c3bb260..7a4fbb655d 100644 --- a/components/dfs/Kconfig +++ b/components/dfs/Kconfig @@ -122,6 +122,12 @@ if RT_USING_DFS config RT_DFS_ELM_REENTRANT bool "Enable the reentrancy (thread safe) of the FatFs module" default y + + config RT_DFS_ELM_MUTEX_TIMEOUT + int "Timeout of thread-safe protection mutex" + range 0 1000000 + default 3000 + depends on RT_DFS_ELM_REENTRANT endmenu endif diff --git a/components/dfs/filesystems/.ignore_format.yml b/components/dfs/filesystems/.ignore_format.yml new file mode 100644 index 0000000000..e72719df1d --- /dev/null +++ b/components/dfs/filesystems/.ignore_format.yml @@ -0,0 +1,4 @@ +# files format check exclude path, please follow the instructions below to modify; + +dir_path: +- elmfat diff --git a/components/dfs/filesystems/elmfat/dfs_elm.c b/components/dfs/filesystems/elmfat/dfs_elm.c index 41f99d7b62..01d303f71f 100644 --- a/components/dfs/filesystems/elmfat/dfs_elm.c +++ b/components/dfs/filesystems/elmfat/dfs_elm.c @@ -945,7 +945,7 @@ DWORD get_fattime(void) { DWORD fat_time = 0; -#ifdef RT_LIBC_USING_TIME +#if defined(RT_LIBC_USING_TIME) || defined(RT_USING_LIBC) time_t now; struct tm *p_tm; struct tm tm_now; @@ -968,7 +968,7 @@ DWORD get_fattime(void) (DWORD)tm_now.tm_hour << 11 | (DWORD)tm_now.tm_min << 5 | (DWORD)tm_now.tm_sec / 2 ; -#endif /* RT_USING_LIBC */ +#endif /* defined(RT_LIBC_USING_TIME) || defined(RT_USING_LIBC) */ return fat_time; } diff --git a/components/dfs/filesystems/elmfat/ffconf.h b/components/dfs/filesystems/elmfat/ffconf.h index a17a07d8ea..a6dcebe228 100644 --- a/components/dfs/filesystems/elmfat/ffconf.h +++ b/components/dfs/filesystems/elmfat/ffconf.h @@ -295,12 +295,16 @@ / lock control is independent of re-entrancy. */ /* #include <somertos.h> // O/S definitions */ +#include <rtdef.h> #ifdef RT_DFS_ELM_REENTRANT #define FF_FS_REENTRANT 1 /* 0 or 1 */ #else #define FF_FS_REENTRANT 0 /* 0:Disable or 1:Enable */ #endif -#define FF_FS_TIMEOUT 1000 +#ifndef RT_DFS_ELM_MUTEX_TIMEOUT +#define RT_DFS_ELM_MUTEX_TIMEOUT 3000 +#endif +#define FF_FS_TIMEOUT RT_DFS_ELM_MUTEX_TIMEOUT #define FF_SYNC_t rt_mutex_t /* The option FF_FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs / module itself. Note that regardless of this option, file access to different diff --git a/components/dfs/src/dfs_select.c b/components/dfs/src/dfs_select.c index ca9c549259..795b816354 100644 --- a/components/dfs/src/dfs_select.c +++ b/components/dfs/src/dfs_select.c @@ -12,7 +12,7 @@ #include <dfs_posix.h> #include <poll.h> -#include <dfs_select.h> +#include <sys/select.h> #ifdef RT_USING_POSIX |
