|
30 | 30 | / f_findnext(). (0:Disable, 1:Enable 2:Enable with matching altname[] too) */ |
31 | 31 |
|
32 | 32 |
|
33 | | -#define FF_USE_MKFS 0 |
| 33 | +#define FF_USE_MKFS 1 |
34 | 34 | /* This option switches f_mkfs() function. (0:Disable or 1:Enable) */ |
35 | 35 |
|
36 | 36 |
|
37 | | -#define FF_USE_FASTSEEK 0 |
| 37 | +#define FF_USE_FASTSEEK 1 |
38 | 38 | /* This option switches fast seek function. (0:Disable or 1:Enable) */ |
39 | 39 |
|
40 | 40 |
|
|
57 | 57 |
|
58 | 58 |
|
59 | 59 | #define FF_USE_STRFUNC 0 |
60 | | -#define FF_PRINT_LLI 1 |
61 | | -#define FF_PRINT_FLOAT 1 |
| 60 | +#define FF_PRINT_LLI 0 |
| 61 | +#define FF_PRINT_FLOAT 0 |
62 | 62 | #define FF_STRF_ENCODE 3 |
63 | 63 | /* FF_USE_STRFUNC switches string functions, f_gets(), f_putc(), f_puts() and |
64 | 64 | / f_printf(). |
|
84 | 84 | / Locale and Namespace Configurations |
85 | 85 | /---------------------------------------------------------------------------*/ |
86 | 86 |
|
87 | | -#define FF_CODE_PAGE 932 |
| 87 | +#ifdef RT_DFS_ELM_CODE_PAGE |
| 88 | +# define FF_CODE_PAGE RT_DFS_ELM_CODE_PAGE |
| 89 | +#else |
| 90 | +# define FF_CODE_PAGE 936 |
| 91 | +#endif |
88 | 92 | /* This option specifies the OEM code page to be used on the target system. |
89 | 93 | / Incorrect code page setting can cause a file open failure. |
90 | 94 | / |
|
113 | 117 | */ |
114 | 118 |
|
115 | 119 |
|
116 | | -#define FF_USE_LFN 0 |
117 | | -#define FF_MAX_LFN 255 |
| 120 | +#if RT_DFS_ELM_USE_LFN |
| 121 | +#define FF_USE_LFN RT_DFS_ELM_USE_LFN |
| 122 | +#define FF_MAX_LFN RT_DFS_ELM_MAX_LFN |
| 123 | +#else |
| 124 | +#define FF_USE_LFN 0 /* 0 to 3 */ |
| 125 | +#define FF_MAX_LFN 255 /* Maximum LFN length to handle (12 to 255) */ |
| 126 | +#endif |
118 | 127 | /* The FF_USE_LFN switches the support for LFN (long file name). |
119 | 128 | / |
120 | 129 | / 0: Disable LFN. FF_MAX_LFN has no effect. |
|
133 | 142 | / ff_memfree() exemplified in ffsystem.c, need to be added to the project. */ |
134 | 143 |
|
135 | 144 |
|
136 | | -#define FF_LFN_UNICODE 0 |
| 145 | +#ifdef RT_DFS_ELM_LFN_UNICODE |
| 146 | +/* This option switches the character encoding on the API when LFN is enabled. |
| 147 | +/ |
| 148 | +/ 0: ANSI/OEM in current CP (TCHAR = char) |
| 149 | +/ 1: Unicode in UTF-16 (TCHAR = WCHAR) |
| 150 | +/ 2: Unicode in UTF-8 (TCHAR = char) |
| 151 | +/ 3: Unicode in UTF-32 (TCHAR = DWORD) |
| 152 | +/ |
| 153 | +/ Also behavior of string I/O functions will be affected by this option. |
| 154 | +/ When LFN is not enabled, this option has no effect. */ |
| 155 | +#define FF_LFN_UNICODE RT_DFS_ELM_LFN_UNICODE /* 0:ANSI/OEM or 1:Unicode */ |
| 156 | +#else |
| 157 | +#define FF_LFN_UNICODE 0 /* 0:ANSI/OEM or 1:Unicode */ |
| 158 | +#endif |
137 | 159 | /* This option switches the character encoding on the API when LFN is enabled. |
138 | 160 | / |
139 | 161 | / 0: ANSI/OEM in current CP (TCHAR = char) |
|
166 | 188 | / Drive/Volume Configurations |
167 | 189 | /---------------------------------------------------------------------------*/ |
168 | 190 |
|
169 | | -#define FF_VOLUMES 1 |
| 191 | +#ifdef RT_DFS_ELM_DRIVES |
| 192 | +#define FF_VOLUMES RT_DFS_ELM_DRIVES |
| 193 | +#else |
| 194 | +#define FF_VOLUMES 1 |
| 195 | +#endif |
170 | 196 | /* Number of volumes (logical drives) to be used. (1-10) */ |
171 | 197 |
|
172 | 198 |
|
|
194 | 220 |
|
195 | 221 |
|
196 | 222 | #define FF_MIN_SS 512 |
197 | | -#define FF_MAX_SS 512 |
| 223 | +#ifdef RT_DFS_ELM_MAX_SECTOR_SIZE |
| 224 | +#define FF_MAX_SS RT_DFS_ELM_MAX_SECTOR_SIZE |
| 225 | +#else |
| 226 | +#define FF_MAX_SS 512 /* 512, 1024, 2048 or 4096 */ |
| 227 | +#endif |
198 | 228 | /* This set of options configures the range of sector size to be supported. (512, |
199 | 229 | / 1024, 2048 or 4096) Always set both 512 for most systems, generic memory card and |
200 | 230 | / harddisk, but a larger value may be required for on-board flash memory and some |
|
230 | 260 | / Instead of private sector buffer eliminated from the file object, common sector |
231 | 261 | / buffer in the filesystem object (FATFS) is used for the file data transfer. */ |
232 | 262 |
|
233 | | - |
234 | | -#define FF_FS_EXFAT 0 |
| 263 | +#ifdef RT_DFS_ELM_USE_EXFAT |
| 264 | +#define FF_FS_EXFAT 1 |
| 265 | +#else |
| 266 | +#define FF_FS_EXFAT 0 |
| 267 | +#endif |
235 | 268 | /* This option switches support for exFAT filesystem. (0:Disable or 1:Enable) |
236 | 269 | / To enable exFAT, also LFN needs to be enabled. (FF_USE_LFN >= 1) |
237 | 270 | / Note that enabling exFAT discards ANSI C (C89) compatibility. */ |
|
275 | 308 | / lock control is independent of re-entrancy. */ |
276 | 309 |
|
277 | 310 |
|
278 | | -#define FF_FS_REENTRANT 0 |
279 | | -#define FF_FS_TIMEOUT 1000 |
| 311 | +/* #include <somertos.h> // O/S definitions */ |
| 312 | +#include <rtdef.h> |
| 313 | +#ifdef RT_DFS_ELM_REENTRANT |
| 314 | +#define FF_FS_REENTRANT 1 /* 0 or 1 */ |
| 315 | +#else |
| 316 | +#define FF_FS_REENTRANT 0 /* 0:Disable or 1:Enable */ |
| 317 | +#endif |
| 318 | +#ifndef RT_DFS_ELM_MUTEX_TIMEOUT |
| 319 | +#define RT_DFS_ELM_MUTEX_TIMEOUT 3000 |
| 320 | +#endif |
| 321 | +#define FF_FS_TIMEOUT RT_DFS_ELM_MUTEX_TIMEOUT |
| 322 | +#define FF_SYNC_t rt_mutex_t |
280 | 323 | /* The option FF_FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs |
281 | 324 | / module itself. Note that regardless of this option, file access to different |
282 | 325 | / volume is always re-entrant and volume control functions, f_mount(), f_mkfs() |
|
0 commit comments