File tree Expand file tree Collapse file tree 4 files changed +17
-3
lines changed
Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,12 @@ if RT_USING_DFS
122122 config RT_DFS_ELM_REENTRANT
123123 bool "Enable the reentrancy (thread safe) of the FatFs module"
124124 default y
125+
126+ config RT_DFS_ELM_MUTEX_TIMEOUT
127+ int "Timeout of thread-safe protection mutex"
128+ range 0 1000000
129+ default 3000
130+ depends on RT_DFS_ELM_REENTRANT
125131 endmenu
126132 endif
127133
Original file line number Diff line number Diff line change 1+ # files format check exclude path, please follow the instructions below to modify;
2+
3+ dir_path :
4+ - elmfat
Original file line number Diff line number Diff line change @@ -945,7 +945,7 @@ DWORD get_fattime(void)
945945{
946946 DWORD fat_time = 0 ;
947947
948- #ifdef RT_LIBC_USING_TIME
948+ #if defined( RT_LIBC_USING_TIME ) || defined( RT_USING_LIBC )
949949 time_t now ;
950950 struct tm * p_tm ;
951951 struct tm tm_now ;
@@ -968,7 +968,7 @@ DWORD get_fattime(void)
968968 (DWORD )tm_now .tm_hour << 11 |
969969 (DWORD )tm_now .tm_min << 5 |
970970 (DWORD )tm_now .tm_sec / 2 ;
971- #endif /* RT_USING_LIBC */
971+ #endif /* defined(RT_LIBC_USING_TIME) || defined(RT_USING_LIBC) */
972972
973973 return fat_time ;
974974}
Original file line number Diff line number Diff line change 295295/ lock control is independent of re-entrancy. */
296296
297297/* #include <somertos.h> // O/S definitions */
298+ #include <rtdef.h>
298299#ifdef RT_DFS_ELM_REENTRANT
299300#define FF_FS_REENTRANT 1 /* 0 or 1 */
300301#else
301302#define FF_FS_REENTRANT 0 /* 0:Disable or 1:Enable */
302303#endif
303- #define FF_FS_TIMEOUT 1000
304+ #ifndef RT_DFS_ELM_MUTEX_TIMEOUT
305+ #define RT_DFS_ELM_MUTEX_TIMEOUT 3000
306+ #endif
307+ #define FF_FS_TIMEOUT RT_DFS_ELM_MUTEX_TIMEOUT
304308#define FF_SYNC_t rt_mutex_t
305309/* The option FF_FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs
306310/ module itself. Note that regardless of this option, file access to different
You can’t perform that action at this time.
0 commit comments