Merge pull request #11851 from amq/patch-2

Enable FAT ChaN lib configuration with mbed_lib.json
pull/11930/head
Martin Kojtal 2019-11-22 13:38:56 +01:00 committed by GitHub
commit 04ed9c5c8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 286 additions and 40 deletions

View File

@ -17,3 +17,84 @@ set(unittest-sources
set(unittest-test-sources
features/storage/blockdevice/HeapBlockDevice/test.cpp
)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FFS_DBG=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_READONLY=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_MINIMIZE=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_STRFUNC=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FIND=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_MKFS=1")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FASTSEEK=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_EXPAND=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_CHMOD=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_LABEL=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FORWARD=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_CODE_PAGE=437")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_LFN=3")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MAX_LFN=255")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_LFN_UNICODE=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_LFN_BUF=255")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_SFN_BUF=12")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_STRF_ENCODE=3")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_RPATH=1")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_VOLUMES=4")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_STR_VOLUME_ID=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_VOLUME_STRS=\"RAM\",\"NAND\",\"CF\",\"SD\",\"SD2\",\"USB\",\"USB2\",\"USB3\"")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MULTI_PARTITION=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MIN_SS=512")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MAX_SS=4096")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_TRIM=1")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_NOFSINFO=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_TINY=1")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_EXFAT=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_HEAPBUF=1")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_NORTC=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_MON=1")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_MDAY=1")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_YEAR=2017")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_LOCK=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_REENTRANT=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_TIMEOUT=1000")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_SYNC_t=HANDLE")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FLUSH_ON_NEW_CLUSTER=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FLUSH_ON_NEW_SECTOR=1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FFS_DBG=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_READONLY=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_MINIMIZE=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_STRFUNC=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FIND=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_MKFS=1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FASTSEEK=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_EXPAND=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_CHMOD=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_LABEL=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FORWARD=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_CODE_PAGE=437")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_LFN=3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MAX_LFN=255")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_LFN_UNICODE=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_LFN_BUF=255")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_SFN_BUF=12")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_STRF_ENCODE=3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_RPATH=1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_VOLUMES=4")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_STR_VOLUME_ID=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_VOLUME_STRS=\"RAM\",\"NAND\",\"CF\",\"SD\",\"SD2\",\"USB\",\"USB2\",\"USB3\"")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MULTI_PARTITION=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MIN_SS=512")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MAX_SS=4096")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_TRIM=1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_NOFSINFO=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_TINY=1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_EXFAT=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_HEAPBUF=1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_NORTC=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_MON=1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_MDAY=1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_YEAR=2017")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_LOCK=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_REENTRANT=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_TIMEOUT=1000")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_SYNC_t=HANDLE")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FLUSH_ON_NEW_CLUSTER=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FLUSH_ON_NEW_SECTOR=1")

View File

@ -4,20 +4,20 @@
#define FFCONF_DEF 89352 /* Revision ID */
#define FFS_DBG 0
#define FFS_DBG MBED_CONF_FAT_CHAN_FFS_DBG
/*---------------------------------------------------------------------------/
/ Function Configurations
/---------------------------------------------------------------------------*/
#define FF_FS_READONLY 0
#define FF_FS_READONLY MBED_CONF_FAT_CHAN_FF_FS_READONLY
/* This option switches read-only configuration. (0:Read/Write or 1:Read-only)
/ Read-only configuration removes writing API functions, f_write(), f_sync(),
/ f_unlink(), f_mkdir(), f_chmod(), f_rename(), f_truncate(), f_getfree()
/ and optional writing functions as well. */
#define FF_FS_MINIMIZE 0
#define FF_FS_MINIMIZE MBED_CONF_FAT_CHAN_FF_FS_MINIMIZE
/* This option defines minimization level to remove some basic API functions.
/
/ 0: Basic functions are fully enabled.
@ -27,7 +27,7 @@
/ 3: f_lseek() function is removed in addition to 2. */
#define FF_USE_STRFUNC 0
#define FF_USE_STRFUNC MBED_CONF_FAT_CHAN_FF_USE_STRFUNC
/* This option switches string functions, f_gets(), f_putc(), f_puts() and f_printf().
/
/ 0: Disable string functions.
@ -35,34 +35,34 @@
/ 2: Enable with LF-CRLF conversion. */
#define FF_USE_FIND 0
#define FF_USE_FIND MBED_CONF_FAT_CHAN_FF_USE_FIND
/* This option switches filtered directory read functions, f_findfirst() and
/ f_findnext(). (0:Disable, 1:Enable 2:Enable with matching altname[] too) */
#define FF_USE_MKFS 1
#define FF_USE_MKFS MBED_CONF_FAT_CHAN_FF_USE_MKFS
/* This option switches f_mkfs() function. (0:Disable or 1:Enable) */
#define FF_USE_FASTSEEK 0
#define FF_USE_FASTSEEK MBED_CONF_FAT_CHAN_FF_USE_FASTSEEK
/* This option switches fast seek function. (0:Disable or 1:Enable) */
#define FF_USE_EXPAND 0
#define FF_USE_EXPAND MBED_CONF_FAT_CHAN_FF_USE_EXPAND
/* This option switches f_expand function. (0:Disable or 1:Enable) */
#define FF_USE_CHMOD 0
#define FF_USE_CHMOD MBED_CONF_FAT_CHAN_FF_USE_CHMOD
/* This option switches attribute manipulation functions, f_chmod() and f_utime().
/ (0:Disable or 1:Enable) Also FF_FS_READONLY needs to be 0 to enable this option. */
#define FF_USE_LABEL 0
#define FF_USE_LABEL MBED_CONF_FAT_CHAN_FF_USE_LABEL
/* This option switches volume label functions, f_getlabel() and f_setlabel().
/ (0:Disable or 1:Enable) */
#define FF_USE_FORWARD 0
#define FF_USE_FORWARD MBED_CONF_FAT_CHAN_FF_USE_FORWARD
/* This option switches f_forward() function. (0:Disable or 1:Enable) */
@ -70,7 +70,7 @@
/ Locale and Namespace Configurations
/---------------------------------------------------------------------------*/
#define FF_CODE_PAGE 437
#define FF_CODE_PAGE MBED_CONF_FAT_CHAN_FF_CODE_PAGE
/* This option specifies the OEM code page to be used on the target system.
/ Incorrect code page setting can cause a file open failure.
/
@ -99,8 +99,8 @@
*/
#define FF_USE_LFN 3
#define FF_MAX_LFN 255
#define FF_USE_LFN MBED_CONF_FAT_CHAN_FF_USE_LFN
#define FF_MAX_LFN MBED_CONF_FAT_CHAN_FF_MAX_LFN
/* The FF_USE_LFN switches the support for LFN (long file name).
/
/ 0: Disable LFN. FF_MAX_LFN has no effect.
@ -119,7 +119,7 @@
/ ff_memfree() in ffsystem.c, need to be added to the project. */
#define FF_LFN_UNICODE 0
#define FF_LFN_UNICODE MBED_CONF_FAT_CHAN_FF_LFN_UNICODE
/* This option switches the character encoding on the API when LFN is enabled.
/
/ 0: ANSI/OEM in current CP (TCHAR = char)
@ -130,15 +130,15 @@
/ When LFN is not enabled, this option has no effect. */
#define FF_LFN_BUF 255
#define FF_SFN_BUF 12
#define FF_LFN_BUF MBED_CONF_FAT_CHAN_FF_LFN_BUF
#define FF_SFN_BUF MBED_CONF_FAT_CHAN_FF_SFN_BUF
/* This set of options defines size of file name members in the FILINFO structure
/ which is used to read out directory items. These values should be suffcient for
/ the file names to read. The maximum possible length of the read file name depends
/ on character encoding. When LFN is not enabled, these options have no effect. */
#define FF_STRF_ENCODE 3
#define FF_STRF_ENCODE MBED_CONF_FAT_CHAN_FF_STRF_ENCODE
/* When FF_LFN_UNICODE >= 1 with LFN enabled, string I/O functions, f_gets(),
/ f_putc(), f_puts and f_printf() convert the character encoding in it.
/ This option selects assumption of character encoding ON THE FILE to be
@ -151,7 +151,7 @@
*/
#define FF_FS_RPATH 1
#define FF_FS_RPATH MBED_CONF_FAT_CHAN_FF_FS_RPATH
/* This option configures support for relative path.
/
/ 0: Disable relative path and remove related functions.
@ -164,12 +164,12 @@
/ Drive/Volume Configurations
/---------------------------------------------------------------------------*/
#define FF_VOLUMES 4
#define FF_VOLUMES MBED_CONF_FAT_CHAN_FF_VOLUMES
/* Number of volumes (logical drives) to be used. (1-10) */
#define FF_STR_VOLUME_ID 0
#define FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3"
#define FF_STR_VOLUME_ID MBED_CONF_FAT_CHAN_FF_STR_VOLUME_ID
#define FF_VOLUME_STRS MBED_CONF_FAT_CHAN_FF_VOLUME_STRS
/* FF_STR_VOLUME_ID switches string support for volume ID.
/ When FF_STR_VOLUME_ID is set to 1, also pre-defined strings can be used as drive
/ number in the path name. FF_VOLUME_STRS defines the drive ID strings for each
@ -177,7 +177,7 @@
/ the drive ID strings are: A-Z and 0-9. */
#define FF_MULTI_PARTITION 0
#define FF_MULTI_PARTITION MBED_CONF_FAT_CHAN_FF_MULTI_PARTITION
/* This option switches support for multiple volumes on the physical drive.
/ By default (0), each logical drive number is bound to the same physical drive
/ number and only an FAT volume found on the physical drive will be mounted.
@ -186,8 +186,8 @@
/ funciton will be available. */
#define FF_MIN_SS 512
#define FF_MAX_SS 4096
#define FF_MIN_SS MBED_CONF_FAT_CHAN_FF_MIN_SS
#define FF_MAX_SS MBED_CONF_FAT_CHAN_FF_MAX_SS
/* This set of options configures the range of sector size to be supported. (512,
/ 1024, 2048 or 4096) Always set both 512 for most systems, generic memory card and
/ harddisk. But a larger value may be required for on-board flash memory and some
@ -196,13 +196,13 @@
/ GET_SECTOR_SIZE command. */
#define FF_USE_TRIM 1
#define FF_USE_TRIM MBED_CONF_FAT_CHAN_FF_USE_TRIM
/* This option switches support for ATA-TRIM. (0:Disable or 1:Enable)
/ To enable Trim function, also CTRL_TRIM command should be implemented to the
/ disk_ioctl() function. */
#define FF_FS_NOFSINFO 0
#define FF_FS_NOFSINFO MBED_CONF_FAT_CHAN_FF_FS_NOFSINFO
/* If you need to know correct free space on the FAT32 volume, set bit 0 of this
/ option, and f_getfree() function at first time after volume mount will force
/ a full FAT scan. Bit 1 controls the use of last allocated cluster number.
@ -219,20 +219,20 @@
/ System Configurations
/---------------------------------------------------------------------------*/
#define FF_FS_TINY 1
#define FF_FS_TINY MBED_CONF_FAT_CHAN_FF_FS_TINY
/* 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
/ buffer in the filesystem object (FATFS) is used for the file data transfer. */
#define FF_FS_EXFAT 0
#define FF_FS_EXFAT MBED_CONF_FAT_CHAN_FF_FS_EXFAT
/* This option switches support for exFAT filesystem. (0:Disable or 1:Enable)
/ When enable exFAT, also LFN needs to be enabled.
/ Note that enabling exFAT discards ANSI C (C89) compatibility. */
#define FF_FS_HEAPBUF 1
#define FF_FS_HEAPBUF MBED_CONF_FAT_CHAN_FF_FS_HEAPBUF
/* This option enables the use of the heap for allocating buffers. Otherwise
/ _MAX_SS sized buffers are allocated statically in relevant structures (in
/ FATFS if _FS_TINY, otherwise in FATFS and FIL)
@ -240,10 +240,10 @@
/ on underlying sector size. */
#define FF_FS_NORTC 0
#define FF_NORTC_MON 1
#define FF_NORTC_MDAY 1
#define FF_NORTC_YEAR 2017
#define FF_FS_NORTC MBED_CONF_FAT_CHAN_FF_FS_NORTC
#define FF_NORTC_MON MBED_CONF_FAT_CHAN_FF_NORTC_MON
#define FF_NORTC_MDAY MBED_CONF_FAT_CHAN_FF_NORTC_MDAY
#define FF_NORTC_YEAR MBED_CONF_FAT_CHAN_FF_NORTC_YEAR
/* The option FF_FS_NORTC switches timestamp functiton. If the system does not have
/ any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable
/ the timestamp function. All objects modified by FatFs will have a fixed timestamp
@ -254,7 +254,7 @@
/ These options have no effect at read-only configuration (FF_FS_READONLY = 1). */
#define FF_FS_LOCK 0
#define FF_FS_LOCK MBED_CONF_FAT_CHAN_FF_FS_LOCK
/* The option FF_FS_LOCK switches file lock function to control duplicated file open
/ and illegal operation to open objects. This option must be 0 when FF_FS_READONLY
/ is 1.
@ -266,9 +266,9 @@
/ lock control is independent of re-entrancy. */
#define FF_FS_REENTRANT 0
#define FF_FS_TIMEOUT 1000
#define FF_SYNC_t HANDLE
#define FF_FS_REENTRANT MBED_CONF_FAT_CHAN_FF_FS_REENTRANT
#define FF_FS_TIMEOUT MBED_CONF_FAT_CHAN_FF_FS_TIMEOUT
#define FF_SYNC_t MBED_CONF_FAT_CHAN_FF_SYNC_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
/ volume is always re-entrant and volume control functions, f_mount(), f_mkfs()
@ -288,8 +288,8 @@
/* #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_CLUSTER MBED_CONF_FAT_CHAN_FLUSH_ON_NEW_CLUSTER /* Sync the file on every new cluster */
#define FLUSH_ON_NEW_SECTOR MBED_CONF_FAT_CHAN_FLUSH_ON_NEW_SECTOR /* 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

View File

@ -0,0 +1,165 @@
{
"name": "fat_chan",
"config": {
"ffs_dbg": {
"help": "Switches debug mode. 0: disable, 1: enable.",
"value": "0"
},
"ff_fs_readonly": {
"help": "Switches read-only configuration. 0: read/write, 1: read-only.",
"value": "0"
},
"ff_fs_minimize": {
"help": "Defines minimization level to remove some basic API functions. 0: all functions enabled, 1: f_stat() removed, 2: f_opendir() removed in addition to 1, 3: f_lseek() removed in addition to 2.",
"value": "0"
},
"ff_use_strfunc": {
"help": "Switches string functions. 0: disable string functions, 1: enable without LF-CRLF conversion, 2: enable with LF-CRLF conversion.",
"value": "0"
},
"ff_use_find": {
"help": "Switches filtered directory read functions. 0: disable, 1: enable, 2: enable with matching altname[] too.",
"value": "0"
},
"ff_use_mkfs": {
"help": "Switches f_mkfs() function. 0: disable, 1: enable.",
"value": "1"
},
"ff_use_fastseek": {
"help": "Switches fast seek function. 0: disable, 1: enable.",
"value": "0"
},
"ff_use_expand": {
"help": "Switches f_expand function. 0: disable, 1: enable.",
"value": "0"
},
"ff_use_chmod": {
"help": "Switches attribute manipulation functions. 0: disable, 1: enable. ff_fs_readonly needs to be 0 to enable this option.",
"value": "0"
},
"ff_use_label": {
"help": "Switches volume label functions. 0: disable, 1: enable.",
"value": "0"
},
"ff_use_forward": {
"help": "Switches f_forward() function. 0: disable, 1: enable.",
"value": "0"
},
"ff_code_page": {
"help": "Specifies the OEM code page to be used on the target system.",
"value": "437"
},
"ff_use_lfn": {
"help": "Switches the support for LFN (long file name). 0: disable LFN, 1: enable LFN with static working buffer on the BSS, always NOT thread-safe, 2: enable LFN with dynamic working buffer on the STACK, 3: enable LFN with dynamic working buffer on the HEAP.",
"value": "3"
},
"ff_max_lfn": {
"help": "Defines size of the working buffer in UTF-16 code unit and it can be in range of 12 to 255. It is recommended to be set 255 to fully support LFN specification.",
"value": "255"
},
"ff_lfn_unicode": {
"help": "Switches the character encoding on the API when LFN is enabled. 0: ANSI/OEM in current CP (TCHAR = char), 1: unicode in UTF-16 (TCHAR = WCHAR), 2: unicode in UTF-8 (TCHAR = char).",
"value": "0"
},
"ff_lfn_buf": {
"help": "Defines size of file name members in the FILINFO structure which is used to read out directory items. The value should be suffcient for the file names to read. The maximum possible length of the read file name depends on character encoding. When LFN is not enabled, these options have no effect.",
"value": "255"
},
"ff_sfn_buf": {
"help": "See ff_lfn_buf.",
"value": "12"
},
"ff_strf_encode": {
"help": "When FF_LFN_UNICODE >= 1 with LFN enabled, string I/O functions convert the character encoding in it. This option selects assumption of character encoding ON THE FILE to be read/written via those functions. 0: ANSI/OEM in current CP, 1: unicode in UTF-16LE, 2: unicode in UTF-16BE, 3: unicode in UTF-8.",
"value": "3"
},
"ff_fs_rpath": {
"help": "Configures support for relative path. 0: disable relative path and remove related functions, 1: enable relative path. f_chdir() and f_chdrive() are available, 2: f_getcwd() function is available in addition to 1.",
"value": "1"
},
"ff_volumes": {
"help": "Number of volumes (logical drives) to be used. (1-10).",
"value": "4"
},
"ff_str_volume_id": {
"help": "Switches string support for volume ID. When ff_volume_strs is set to 1, also pre-defined strings can be used as drive number in the path name.",
"value": "0"
},
"ff_volume_strs": {
"help": "Defines the drive ID strings for each logical drive. Number of items must be equal to ff_volumes. Valid characters for the drive ID strings are: A-Z and 0-9.",
"value": "\"RAM\",\"NAND\",\"CF\",\"SD\",\"SD2\",\"USB\",\"USB2\",\"USB3\""
},
"ff_multi_partition": {
"help": "Switches support for multiple volumes on the physical drive. By default (0), each logical drive number is bound to the same physical drive number and only an FAT volume found on the physical drive will be mounted. When this function is enabled (1), each logical drive number can be bound to arbitrary physical drive.",
"value": "0"
},
"ff_min_ss": {
"help": "This and the next option configures the range of sector size to be supported. (512, 1024, 2048 or 4096) Always set both 512 for most systems, generic memory card and harddisk. But a larger value may be required for on-board flash memory and some type of optical media.",
"value": "512"
},
"ff_max_ss": {
"help": "When ff_max_ss is larger than ff_min_ss, FatFs is configured for variable sector size mode.",
"value": "4096"
},
"ff_use_trim": {
"help": "Switches support for ATA-TRIM. 0: disable, 1: enable",
"value": "1"
},
"ff_fs_nofsinfo": {
"help": "If you need to know correct free space on the FAT32 volume, set bit 0 of this option, and f_getfree() function at first time after volume mount will force a full FAT scan. Bit 1 controls the use of last allocated cluster number.",
"value": "0"
},
"ff_fs_tiny": {
"help": "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 buffer in the filesystem object (FATFS) is used for the file data transfer.",
"value": "1"
},
"ff_fs_exfat": {
"help": "Switches support for exFAT filesystem. 0: disable, 1: enable. When enable exFAT, also LFN needs to be enabled. Note that enabling exFAT discards ANSI C (C89) compatibility.",
"value": "0"
},
"ff_fs_heapbuf": {
"help": "Enables the use of the heap for allocating buffers. Otherwise _max_ss sized buffers are allocated statically in relevant structures (in FATFS if _fs_tiny, otherwise in FATFS and FIL).",
"value": "1"
},
"ff_fs_nortc": {
"help": "Switches timestamp functiton. If the system does not have any RTC function or valid timestamp is not needed, set to 1 to disable the timestamp function. All objects modified by FatFs will have a fixed timestamp defined by ff_nortc_mon, ff_nortc_mday and ff_nortc_year in local time.",
"value": "0"
},
"ff_nortc_mon": {
"help": "See ff_fs_nortc.",
"value": "1"
},
"ff_nortc_mday": {
"help": "See ff_fs_nortc.",
"value": "1"
},
"ff_nortc_year": {
"help": "See ff_fs_nortc.",
"value": "2017"
},
"ff_fs_lock": {
"help": "Switches file lock function to control duplicated file open and illegal operation to open objects. This option must be 0 when ff_fs_readonly is 1. The value defines how many files/sub-directories can be opened simultaneously under file lock control. Note that the file lock control is independent of re-entrancy.",
"value": "0"
},
"ff_fs_reentrant": {
"help": "Switches the re-entrancy (thread safe) of the FatFs module itself. Note that regardless of this option, file access to different volume is always re-entrant and volume control functions. 0: disable re-entrancy. ff_fs_timeout and ff_sync_t have no effect. 1: enable re-entrancy. Also user provided synchronization handlers must be added to the project. Samples are available in option/syscall.c.",
"value": "0"
},
"ff_fs_timeout": {
"help": "Defines timeout period in unit of time tick.",
"value": "1000"
},
"ff_sync_t": {
"help": "Defines O/S dependent sync object type. e.g. HANDLE, ID, OS_EVENT* and SemaphoreHandle_t.",
"value": "HANDLE"
},
"flush_on_new_cluster": {
"help": "Sync the file on every new cluster.",
"value": "0"
},
"flush_on_new_sector": {
"help": "Sync the file on every new sector.",
"value": "1"
}
}
}