Skip to content

Commit 28899cd

Browse files
committed
lib/oofatfs: Update oofatfs library.
From https://github.com/micropython/oofatfs, branch work-R0.12b, commit 46fb53331e7a583c29a41d37ce4b53f2718597e5.
1 parent a5bed53 commit 28899cd

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

lib/oofatfs/ff.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#include "ff.h" /* Declarations of FatFs API */
2828
#include "diskio.h" /* Declarations of device I/O functions */
2929

30+
// DIR has been renamed FF_DIR in the public API so it doesn't clash with POSIX
31+
#define DIR FF_DIR
3032

3133
/*--------------------------------------------------------------------------
3234
@@ -3104,7 +3106,7 @@ FRESULT f_mount (
31043106

31053107
fs->fs_type = 0; /* Clear new fs object */
31063108
#if _FS_REENTRANT /* Create sync object for the new volume */
3107-
if (!ff_cre_syncobj((BYTE)vol, &fs->sobj)) return FR_INT_ERR;
3109+
if (!ff_cre_syncobj(fs, &fs->sobj)) return FR_INT_ERR;
31083110
#endif
31093111

31103112
res = find_volume(fs, 0); /* Force mounted the volume */
@@ -3562,7 +3564,9 @@ FRESULT f_sync (
35623564
FATFS *fs;
35633565
DWORD tm;
35643566
BYTE *dir;
3567+
#if _FS_EXFAT
35653568
DEF_NAMBUF
3569+
#endif
35663570

35673571

35683572
res = validate(&fp->obj, &fs); /* Check validity of the file object */

lib/oofatfs/ff.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ typedef struct {
197197

198198

199199

200-
/* Directory object structure (DIR) */
200+
/* Directory object structure (FF_DIR) */
201201

202202
typedef struct {
203203
_FDID obj; /* Object identifier */
@@ -212,7 +212,7 @@ typedef struct {
212212
#if _USE_FIND
213213
const TCHAR* pat; /* Pointer to the name matching pattern */
214214
#endif
215-
} DIR;
215+
} FF_DIR;
216216

217217

218218

@@ -270,11 +270,11 @@ FRESULT f_write (FIL* fp, const void* buff, UINT btw, UINT* bw); /* Write dat
270270
FRESULT f_lseek (FIL* fp, FSIZE_t ofs); /* Move file pointer of the file object */
271271
FRESULT f_truncate (FIL* fp); /* Truncate the file */
272272
FRESULT f_sync (FIL* fp); /* Flush cached data of the writing file */
273-
FRESULT f_opendir (FATFS *fs, DIR* dp, const TCHAR* path); /* Open a directory */
274-
FRESULT f_closedir (DIR* dp); /* Close an open directory */
275-
FRESULT f_readdir (DIR* dp, FILINFO* fno); /* Read a directory item */
276-
FRESULT f_findfirst (DIR* dp, FILINFO* fno, const TCHAR* path, const TCHAR* pattern); /* Find first file */
277-
FRESULT f_findnext (DIR* dp, FILINFO* fno); /* Find next file */
273+
FRESULT f_opendir (FATFS *fs, FF_DIR* dp, const TCHAR* path); /* Open a directory */
274+
FRESULT f_closedir (FF_DIR* dp); /* Close an open directory */
275+
FRESULT f_readdir (FF_DIR* dp, FILINFO* fno); /* Read a directory item */
276+
FRESULT f_findfirst (FF_DIR* dp, FILINFO* fno, const TCHAR* path, const TCHAR* pattern); /* Find first file */
277+
FRESULT f_findnext (FF_DIR* dp, FILINFO* fno); /* Find next file */
278278
FRESULT f_mkdir (FATFS *fs, const TCHAR* path); /* Create a sub directory */
279279
FRESULT f_unlink (FATFS *fs, const TCHAR* path); /* Delete an existing file or directory */
280280
FRESULT f_rename (FATFS *fs, const TCHAR* path_old, const TCHAR* path_new); /* Rename/Move a file or directory */
@@ -327,7 +327,7 @@ void ff_memfree (void* mblock); /* Free memory block */
327327

328328
/* Sync functions */
329329
#if _FS_REENTRANT
330-
int ff_cre_syncobj (BYTE vol, _SYNC_t* sobj); /* Create a sync object */
330+
int ff_cre_syncobj (FATFS *fatfs, _SYNC_t* sobj); /* Create a sync object */
331331
int ff_req_grant (_SYNC_t sobj); /* Lock sync object */
332332
void ff_rel_grant (_SYNC_t sobj); /* Unlock sync object */
333333
int ff_del_syncobj (_SYNC_t sobj); /* Delete a sync object */

0 commit comments

Comments
 (0)