Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions components/dfs/dfs_v2/filesystems/elmfat/00history.txt
Original file line number Diff line number Diff line change
Expand Up @@ -357,3 +357,13 @@ R0.14b (April 17, 2021)
Fixed some compiler warnings.



R0.15 (November 6, 2022)
Changed user provided synchronization functions in order to completely eliminate the platform dependency from FatFs code.
FF_SYNC_t is removed from the configuration options.
Fixed a potential error in f_mount when FF_FS_REENTRANT.
Fixed file lock control FF_FS_LOCK is not mutal excluded when FF_FS_REENTRANT && FF_VOLUMES > 1 is true.
Fixed f_mkfs() creates broken exFAT volume when the size of volume is >= 2^32 sectors.
Fixed string functions cannot write the unicode characters not in BMP when FF_LFN_UNICODE == 2 (UTF-8).
Fixed a compatibility issue in identification of GPT header.

2 changes: 1 addition & 1 deletion components/dfs/dfs_v2/filesystems/elmfat/00readme.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FatFs Module Source Files R0.14b
FatFs Module Source Files R0.15


FILES
Expand Down
28 changes: 13 additions & 15 deletions components/dfs/dfs_v2/filesystems/elmfat/dfs_elm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1218,41 +1218,39 @@ DWORD get_fattime(void)
}

#if FF_FS_REENTRANT
int ff_cre_syncobj(BYTE drv, FF_SYNC_t *m)

static rt_mutex_t Mutex[FF_VOLUMES + 1];

int ff_mutex_create (int vol)
{
char name[8];
rt_mutex_t mutex;

rt_snprintf(name, sizeof(name), "fat%d", drv);
rt_snprintf(name, sizeof(name), "fat%d", vol);
mutex = rt_mutex_create(name, RT_IPC_FLAG_PRIO);
if (mutex != RT_NULL)
{
*m = mutex;
Mutex[vol] = mutex;
return RT_TRUE;
}

return RT_FALSE;
}

int ff_del_syncobj(FF_SYNC_t m)
void ff_mutex_delete (int vol)
{
if (m != RT_NULL)
rt_mutex_delete(m);

return RT_TRUE;
if (Mutex[vol] != RT_NULL)
rt_mutex_delete(Mutex[vol]);
}

int ff_req_grant(FF_SYNC_t m)
int ff_mutex_take (int vol)
{
if (rt_mutex_take(m, FF_FS_TIMEOUT) == RT_EOK)
if (rt_mutex_take(Mutex[vol], FF_FS_TIMEOUT) == RT_EOK)
return RT_TRUE;

return RT_FALSE;
}

void ff_rel_grant(FF_SYNC_t m)
void ff_mutex_give (int vol)
{
rt_mutex_release(m);
rt_mutex_release(Mutex[vol]);
}

#endif
Expand Down
Loading