TEST
Dependencies: max32630fthr Adafruit_FeatherOLED USBDevice
Diff: mbed_os_patches/fffix.patch
- Revision:
- 1:f60eafbf009a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed_os_patches/fffix.patch Wed Apr 10 14:56:25 2019 +0300 @@ -0,0 +1,88 @@ +diff --git a/features/filesystem/fat/ChaN/ff.cpp b/features/filesystem/fat/ChaN/ff.cpp +index 7e4561d809..3bda25e4a9 100644 +--- a/features/filesystem/fat/ChaN/ff.cpp ++++ b/features/filesystem/fat/ChaN/ff.cpp +@@ -3800,7 +3800,9 @@ FRESULT f_read ( + cc = fs->csize - csect; + } + if (disk_read(fs->pdrv, rbuff, sect, cc) != RES_OK) ABORT(fs, FR_DISK_ERR); +-#if !FF_FS_READONLY && FF_FS_MINIMIZE <= 2 /* Replace one of the read sectors with cached data if it contains a dirty sector */ ++ ++/* ++#if !FF_FS_READONLY && FF_FS_MINIMIZE <= 2 + #if FF_FS_TINY + if (fs->wflag && fs->winsect - sect < cc) { + mem_cpy(rbuff + ((fs->winsect - sect) * SS(fs)), fs->win, SS(fs)); +@@ -3811,6 +3813,8 @@ FRESULT f_read ( + } + #endif + #endif ++*/ ++ + rcnt = SS(fs) * cc; /* Number of bytes transferred */ + continue; + } +@@ -3921,19 +3925,20 @@ FRESULT f_write ( + cc = fs->csize - csect; + } + if (disk_write(fs->pdrv, wbuff, sect, cc) != RES_OK) ABORT(fs, FR_DISK_ERR); ++/* + #if FF_FS_MINIMIZE <= 2 + #if FF_FS_TINY +- if (fs->winsect - sect < cc) { /* Refill sector cache if it gets invalidated by the direct write */ ++ if (fs->winsect - sect < cc) { + mem_cpy(fs->win, wbuff + ((fs->winsect - sect) * SS(fs)), SS(fs)); + fs->wflag = 0; + } + #else +- if (fp->sect - sect < cc) { /* Refill sector cache if it gets invalidated by the direct write */ ++ if (fp->sect - sect < cc) { + mem_cpy(fp->buf, wbuff + ((fp->sect - sect) * SS(fs)), SS(fs)); + fp->flag &= (BYTE)~FA_DIRTY; + } + #endif +-#endif ++#endif*/ + wcnt = SS(fs) * cc; /* Number of bytes transferred */ + #if FLUSH_ON_NEW_SECTOR + need_sync = true; +diff --git a/features/filesystem/fat/ChaN/ffconf.h b/features/filesystem/fat/ChaN/ffconf.h +index 22e1294277..f446778695 100644 +--- a/features/filesystem/fat/ChaN/ffconf.h ++++ b/features/filesystem/fat/ChaN/ffconf.h +@@ -151,7 +151,7 @@ + */ + + +-#define FF_FS_RPATH 1 ++#define FF_FS_RPATH 0 + /* This option configures support for relative path. + / + / 0: Disable relative path and remove related functions. +@@ -164,7 +164,7 @@ + / Drive/Volume Configurations + /---------------------------------------------------------------------------*/ + +-#define FF_VOLUMES 4 ++#define FF_VOLUMES 1 + /* Number of volumes (logical drives) to be used. (1-10) */ + + +@@ -219,7 +219,7 @@ + / System Configurations + /---------------------------------------------------------------------------*/ + +-#define FF_FS_TINY 1 ++#define FF_FS_TINY 0 + /* This option switches tiny buffer configuration. (0:Normal or 1:Tiny) + / At the tiny configuration, size of file object (FIL) is shrinked FF_MAX_SS bytes. + / Instead of private sector buffer eliminated from the file object, common sector +@@ -289,7 +289,7 @@ + /* #include <windows.h> // O/S definitions */ + + #define FLUSH_ON_NEW_CLUSTER 0 /* Sync the file on every new cluster */ +-#define FLUSH_ON_NEW_SECTOR 1 /* Sync the file on every new sector */ ++#define FLUSH_ON_NEW_SECTOR 0 /* Sync the file on every new sector */ + /* Only one of these two defines needs to be set to 1. If both are set to 0 + the file is only sync when closed. + Clusters are group of sectors (eg: 8 sectors). Flushing on new cluster means