Skip to content

Commit 04ed9c5

Browse files
authored
Merge pull request #11851 from amq/patch-2
Enable FAT ChaN lib configuration with mbed_lib.json
2 parents bd0cbdb + 3eaa3e0 commit 04ed9c5

File tree

3 files changed

+286
-40
lines changed

3 files changed

+286
-40
lines changed

UNITTESTS/features/storage/blockdevice/HeapBlockDevice/unittest.cmake

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,84 @@ set(unittest-sources
1717
set(unittest-test-sources
1818
features/storage/blockdevice/HeapBlockDevice/test.cpp
1919
)
20+
21+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FFS_DBG=0")
22+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_READONLY=0")
23+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_MINIMIZE=0")
24+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_STRFUNC=0")
25+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FIND=0")
26+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_MKFS=1")
27+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FASTSEEK=0")
28+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_EXPAND=0")
29+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_CHMOD=0")
30+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_LABEL=0")
31+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FORWARD=0")
32+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_CODE_PAGE=437")
33+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_LFN=3")
34+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MAX_LFN=255")
35+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_LFN_UNICODE=0")
36+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_LFN_BUF=255")
37+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_SFN_BUF=12")
38+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_STRF_ENCODE=3")
39+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_RPATH=1")
40+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_VOLUMES=4")
41+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_STR_VOLUME_ID=0")
42+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_VOLUME_STRS=\"RAM\",\"NAND\",\"CF\",\"SD\",\"SD2\",\"USB\",\"USB2\",\"USB3\"")
43+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MULTI_PARTITION=0")
44+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MIN_SS=512")
45+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MAX_SS=4096")
46+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_TRIM=1")
47+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_NOFSINFO=0")
48+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_TINY=1")
49+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_EXFAT=0")
50+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_HEAPBUF=1")
51+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_NORTC=0")
52+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_MON=1")
53+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_MDAY=1")
54+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_YEAR=2017")
55+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_LOCK=0")
56+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_REENTRANT=0")
57+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_TIMEOUT=1000")
58+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_SYNC_t=HANDLE")
59+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FLUSH_ON_NEW_CLUSTER=0")
60+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FLUSH_ON_NEW_SECTOR=1")
61+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FFS_DBG=0")
62+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_READONLY=0")
63+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_MINIMIZE=0")
64+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_STRFUNC=0")
65+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FIND=0")
66+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_MKFS=1")
67+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FASTSEEK=0")
68+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_EXPAND=0")
69+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_CHMOD=0")
70+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_LABEL=0")
71+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FORWARD=0")
72+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_CODE_PAGE=437")
73+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_LFN=3")
74+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MAX_LFN=255")
75+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_LFN_UNICODE=0")
76+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_LFN_BUF=255")
77+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_SFN_BUF=12")
78+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_STRF_ENCODE=3")
79+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_RPATH=1")
80+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_VOLUMES=4")
81+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_STR_VOLUME_ID=0")
82+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_VOLUME_STRS=\"RAM\",\"NAND\",\"CF\",\"SD\",\"SD2\",\"USB\",\"USB2\",\"USB3\"")
83+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MULTI_PARTITION=0")
84+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MIN_SS=512")
85+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MAX_SS=4096")
86+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_TRIM=1")
87+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_NOFSINFO=0")
88+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_TINY=1")
89+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_EXFAT=0")
90+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_HEAPBUF=1")
91+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_NORTC=0")
92+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_MON=1")
93+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_MDAY=1")
94+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_YEAR=2017")
95+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_LOCK=0")
96+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_REENTRANT=0")
97+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_TIMEOUT=1000")
98+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_SYNC_t=HANDLE")
99+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FLUSH_ON_NEW_CLUSTER=0")
100+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FLUSH_ON_NEW_SECTOR=1")

features/storage/filesystem/fat/ChaN/ffconf.h

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44

55
#define FFCONF_DEF 89352 /* Revision ID */
66

7-
#define FFS_DBG 0
7+
#define FFS_DBG MBED_CONF_FAT_CHAN_FFS_DBG
88

99
/*---------------------------------------------------------------------------/
1010
/ Function Configurations
1111
/---------------------------------------------------------------------------*/
1212

13-
#define FF_FS_READONLY 0
13+
#define FF_FS_READONLY MBED_CONF_FAT_CHAN_FF_FS_READONLY
1414
/* This option switches read-only configuration. (0:Read/Write or 1:Read-only)
1515
/ Read-only configuration removes writing API functions, f_write(), f_sync(),
1616
/ f_unlink(), f_mkdir(), f_chmod(), f_rename(), f_truncate(), f_getfree()
1717
/ and optional writing functions as well. */
1818

1919

20-
#define FF_FS_MINIMIZE 0
20+
#define FF_FS_MINIMIZE MBED_CONF_FAT_CHAN_FF_FS_MINIMIZE
2121
/* This option defines minimization level to remove some basic API functions.
2222
/
2323
/ 0: Basic functions are fully enabled.
@@ -27,50 +27,50 @@
2727
/ 3: f_lseek() function is removed in addition to 2. */
2828

2929

30-
#define FF_USE_STRFUNC 0
30+
#define FF_USE_STRFUNC MBED_CONF_FAT_CHAN_FF_USE_STRFUNC
3131
/* This option switches string functions, f_gets(), f_putc(), f_puts() and f_printf().
3232
/
3333
/ 0: Disable string functions.
3434
/ 1: Enable without LF-CRLF conversion.
3535
/ 2: Enable with LF-CRLF conversion. */
3636

3737

38-
#define FF_USE_FIND 0
38+
#define FF_USE_FIND MBED_CONF_FAT_CHAN_FF_USE_FIND
3939
/* This option switches filtered directory read functions, f_findfirst() and
4040
/ f_findnext(). (0:Disable, 1:Enable 2:Enable with matching altname[] too) */
4141

4242

43-
#define FF_USE_MKFS 1
43+
#define FF_USE_MKFS MBED_CONF_FAT_CHAN_FF_USE_MKFS
4444
/* This option switches f_mkfs() function. (0:Disable or 1:Enable) */
4545

4646

47-
#define FF_USE_FASTSEEK 0
47+
#define FF_USE_FASTSEEK MBED_CONF_FAT_CHAN_FF_USE_FASTSEEK
4848
/* This option switches fast seek function. (0:Disable or 1:Enable) */
4949

5050

51-
#define FF_USE_EXPAND 0
51+
#define FF_USE_EXPAND MBED_CONF_FAT_CHAN_FF_USE_EXPAND
5252
/* This option switches f_expand function. (0:Disable or 1:Enable) */
5353

5454

55-
#define FF_USE_CHMOD 0
55+
#define FF_USE_CHMOD MBED_CONF_FAT_CHAN_FF_USE_CHMOD
5656
/* This option switches attribute manipulation functions, f_chmod() and f_utime().
5757
/ (0:Disable or 1:Enable) Also FF_FS_READONLY needs to be 0 to enable this option. */
5858

5959

60-
#define FF_USE_LABEL 0
60+
#define FF_USE_LABEL MBED_CONF_FAT_CHAN_FF_USE_LABEL
6161
/* This option switches volume label functions, f_getlabel() and f_setlabel().
6262
/ (0:Disable or 1:Enable) */
6363

6464

65-
#define FF_USE_FORWARD 0
65+
#define FF_USE_FORWARD MBED_CONF_FAT_CHAN_FF_USE_FORWARD
6666
/* This option switches f_forward() function. (0:Disable or 1:Enable) */
6767

6868

6969
/*---------------------------------------------------------------------------/
7070
/ Locale and Namespace Configurations
7171
/---------------------------------------------------------------------------*/
7272

73-
#define FF_CODE_PAGE 437
73+
#define FF_CODE_PAGE MBED_CONF_FAT_CHAN_FF_CODE_PAGE
7474
/* This option specifies the OEM code page to be used on the target system.
7575
/ Incorrect code page setting can cause a file open failure.
7676
/
@@ -99,8 +99,8 @@
9999
*/
100100

101101

102-
#define FF_USE_LFN 3
103-
#define FF_MAX_LFN 255
102+
#define FF_USE_LFN MBED_CONF_FAT_CHAN_FF_USE_LFN
103+
#define FF_MAX_LFN MBED_CONF_FAT_CHAN_FF_MAX_LFN
104104
/* The FF_USE_LFN switches the support for LFN (long file name).
105105
/
106106
/ 0: Disable LFN. FF_MAX_LFN has no effect.
@@ -119,7 +119,7 @@
119119
/ ff_memfree() in ffsystem.c, need to be added to the project. */
120120

121121

122-
#define FF_LFN_UNICODE 0
122+
#define FF_LFN_UNICODE MBED_CONF_FAT_CHAN_FF_LFN_UNICODE
123123
/* This option switches the character encoding on the API when LFN is enabled.
124124
/
125125
/ 0: ANSI/OEM in current CP (TCHAR = char)
@@ -130,15 +130,15 @@
130130
/ When LFN is not enabled, this option has no effect. */
131131

132132

133-
#define FF_LFN_BUF 255
134-
#define FF_SFN_BUF 12
133+
#define FF_LFN_BUF MBED_CONF_FAT_CHAN_FF_LFN_BUF
134+
#define FF_SFN_BUF MBED_CONF_FAT_CHAN_FF_SFN_BUF
135135
/* This set of options defines size of file name members in the FILINFO structure
136136
/ which is used to read out directory items. These values should be suffcient for
137137
/ the file names to read. The maximum possible length of the read file name depends
138138
/ on character encoding. When LFN is not enabled, these options have no effect. */
139139

140140

141-
#define FF_STRF_ENCODE 3
141+
#define FF_STRF_ENCODE MBED_CONF_FAT_CHAN_FF_STRF_ENCODE
142142
/* When FF_LFN_UNICODE >= 1 with LFN enabled, string I/O functions, f_gets(),
143143
/ f_putc(), f_puts and f_printf() convert the character encoding in it.
144144
/ This option selects assumption of character encoding ON THE FILE to be
@@ -151,7 +151,7 @@
151151
*/
152152

153153

154-
#define FF_FS_RPATH 1
154+
#define FF_FS_RPATH MBED_CONF_FAT_CHAN_FF_FS_RPATH
155155
/* This option configures support for relative path.
156156
/
157157
/ 0: Disable relative path and remove related functions.
@@ -164,20 +164,20 @@
164164
/ Drive/Volume Configurations
165165
/---------------------------------------------------------------------------*/
166166

167-
#define FF_VOLUMES 4
167+
#define FF_VOLUMES MBED_CONF_FAT_CHAN_FF_VOLUMES
168168
/* Number of volumes (logical drives) to be used. (1-10) */
169169

170170

171-
#define FF_STR_VOLUME_ID 0
172-
#define FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3"
171+
#define FF_STR_VOLUME_ID MBED_CONF_FAT_CHAN_FF_STR_VOLUME_ID
172+
#define FF_VOLUME_STRS MBED_CONF_FAT_CHAN_FF_VOLUME_STRS
173173
/* FF_STR_VOLUME_ID switches string support for volume ID.
174174
/ When FF_STR_VOLUME_ID is set to 1, also pre-defined strings can be used as drive
175175
/ number in the path name. FF_VOLUME_STRS defines the drive ID strings for each
176176
/ logical drives. Number of items must be equal to FF_VOLUMES. Valid characters for
177177
/ the drive ID strings are: A-Z and 0-9. */
178178

179179

180-
#define FF_MULTI_PARTITION 0
180+
#define FF_MULTI_PARTITION MBED_CONF_FAT_CHAN_FF_MULTI_PARTITION
181181
/* This option switches support for multiple volumes on the physical drive.
182182
/ By default (0), each logical drive number is bound to the same physical drive
183183
/ number and only an FAT volume found on the physical drive will be mounted.
@@ -186,8 +186,8 @@
186186
/ funciton will be available. */
187187

188188

189-
#define FF_MIN_SS 512
190-
#define FF_MAX_SS 4096
189+
#define FF_MIN_SS MBED_CONF_FAT_CHAN_FF_MIN_SS
190+
#define FF_MAX_SS MBED_CONF_FAT_CHAN_FF_MAX_SS
191191
/* This set of options configures the range of sector size to be supported. (512,
192192
/ 1024, 2048 or 4096) Always set both 512 for most systems, generic memory card and
193193
/ harddisk. But a larger value may be required for on-board flash memory and some
@@ -196,13 +196,13 @@
196196
/ GET_SECTOR_SIZE command. */
197197

198198

199-
#define FF_USE_TRIM 1
199+
#define FF_USE_TRIM MBED_CONF_FAT_CHAN_FF_USE_TRIM
200200
/* This option switches support for ATA-TRIM. (0:Disable or 1:Enable)
201201
/ To enable Trim function, also CTRL_TRIM command should be implemented to the
202202
/ disk_ioctl() function. */
203203

204204

205-
#define FF_FS_NOFSINFO 0
205+
#define FF_FS_NOFSINFO MBED_CONF_FAT_CHAN_FF_FS_NOFSINFO
206206
/* If you need to know correct free space on the FAT32 volume, set bit 0 of this
207207
/ option, and f_getfree() function at first time after volume mount will force
208208
/ a full FAT scan. Bit 1 controls the use of last allocated cluster number.
@@ -219,31 +219,31 @@
219219
/ System Configurations
220220
/---------------------------------------------------------------------------*/
221221

222-
#define FF_FS_TINY 1
222+
#define FF_FS_TINY MBED_CONF_FAT_CHAN_FF_FS_TINY
223223
/* This option switches tiny buffer configuration. (0:Normal or 1:Tiny)
224224
/ At the tiny configuration, size of file object (FIL) is shrinked FF_MAX_SS bytes.
225225
/ Instead of private sector buffer eliminated from the file object, common sector
226226
/ buffer in the filesystem object (FATFS) is used for the file data transfer. */
227227

228228

229-
#define FF_FS_EXFAT 0
229+
#define FF_FS_EXFAT MBED_CONF_FAT_CHAN_FF_FS_EXFAT
230230
/* This option switches support for exFAT filesystem. (0:Disable or 1:Enable)
231231
/ When enable exFAT, also LFN needs to be enabled.
232232
/ Note that enabling exFAT discards ANSI C (C89) compatibility. */
233233

234234

235-
#define FF_FS_HEAPBUF 1
235+
#define FF_FS_HEAPBUF MBED_CONF_FAT_CHAN_FF_FS_HEAPBUF
236236
/* This option enables the use of the heap for allocating buffers. Otherwise
237237
/ _MAX_SS sized buffers are allocated statically in relevant structures (in
238238
/ FATFS if _FS_TINY, otherwise in FATFS and FIL)
239239
/ This option allows the filesystem to dynamically allocate the buffers based
240240
/ on underlying sector size. */
241241

242242

243-
#define FF_FS_NORTC 0
244-
#define FF_NORTC_MON 1
245-
#define FF_NORTC_MDAY 1
246-
#define FF_NORTC_YEAR 2017
243+
#define FF_FS_NORTC MBED_CONF_FAT_CHAN_FF_FS_NORTC
244+
#define FF_NORTC_MON MBED_CONF_FAT_CHAN_FF_NORTC_MON
245+
#define FF_NORTC_MDAY MBED_CONF_FAT_CHAN_FF_NORTC_MDAY
246+
#define FF_NORTC_YEAR MBED_CONF_FAT_CHAN_FF_NORTC_YEAR
247247
/* The option FF_FS_NORTC switches timestamp functiton. If the system does not have
248248
/ any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable
249249
/ the timestamp function. All objects modified by FatFs will have a fixed timestamp
@@ -254,7 +254,7 @@
254254
/ These options have no effect at read-only configuration (FF_FS_READONLY = 1). */
255255

256256

257-
#define FF_FS_LOCK 0
257+
#define FF_FS_LOCK MBED_CONF_FAT_CHAN_FF_FS_LOCK
258258
/* The option FF_FS_LOCK switches file lock function to control duplicated file open
259259
/ and illegal operation to open objects. This option must be 0 when FF_FS_READONLY
260260
/ is 1.
@@ -266,9 +266,9 @@
266266
/ lock control is independent of re-entrancy. */
267267

268268

269-
#define FF_FS_REENTRANT 0
270-
#define FF_FS_TIMEOUT 1000
271-
#define FF_SYNC_t HANDLE
269+
#define FF_FS_REENTRANT MBED_CONF_FAT_CHAN_FF_FS_REENTRANT
270+
#define FF_FS_TIMEOUT MBED_CONF_FAT_CHAN_FF_FS_TIMEOUT
271+
#define FF_SYNC_t MBED_CONF_FAT_CHAN_FF_SYNC_t
272272
/* The option FF_FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs
273273
/ module itself. Note that regardless of this option, file access to different
274274
/ volume is always re-entrant and volume control functions, f_mount(), f_mkfs()
@@ -288,8 +288,8 @@
288288

289289
/* #include <windows.h> // O/S definitions */
290290

291-
#define FLUSH_ON_NEW_CLUSTER 0 /* Sync the file on every new cluster */
292-
#define FLUSH_ON_NEW_SECTOR 1 /* Sync the file on every new sector */
291+
#define FLUSH_ON_NEW_CLUSTER MBED_CONF_FAT_CHAN_FLUSH_ON_NEW_CLUSTER /* Sync the file on every new cluster */
292+
#define FLUSH_ON_NEW_SECTOR MBED_CONF_FAT_CHAN_FLUSH_ON_NEW_SECTOR /* Sync the file on every new sector */
293293
/* Only one of these two defines needs to be set to 1. If both are set to 0
294294
the file is only sync when closed.
295295
Clusters are group of sectors (eg: 8 sectors). Flushing on new cluster means

0 commit comments

Comments
 (0)