|
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(). (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 feature. (0:Disable or 1:Enable) */ |
39 | 39 |
|
40 | 40 |
|
|
59 | 59 | #define FF_USE_STRFUNC 0 |
60 | 60 | #define FF_PRINT_LLI 0 |
61 | 61 | #define FF_PRINT_FLOAT 0 |
62 | | -#define FF_STRF_ENCODE 0 |
| 62 | +#define FF_STRF_ENCODE 3 |
63 | 63 | /* FF_USE_STRFUNC switches string API functions, f_gets(), f_putc(), f_puts() and |
64 | 64 | / f_printf(). |
65 | 65 | / |
|
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) |
|
178 | 200 | / Drive/Volume Configurations |
179 | 201 | /---------------------------------------------------------------------------*/ |
180 | 202 |
|
181 | | -#define FF_VOLUMES 1 |
| 203 | +#ifdef RT_DFS_ELM_DRIVES |
| 204 | +#define FF_VOLUMES RT_DFS_ELM_DRIVES |
| 205 | +#else |
| 206 | +#define FF_VOLUMES 1 |
| 207 | +#endif |
182 | 208 | /* Number of volumes (logical drives) to be used. (1-10) */ |
183 | 209 |
|
184 | 210 |
|
|
206 | 232 |
|
207 | 233 |
|
208 | 234 | #define FF_MIN_SS 512 |
209 | | -#define FF_MAX_SS 512 |
| 235 | +#ifdef RT_DFS_ELM_MAX_SECTOR_SIZE |
| 236 | +#define FF_MAX_SS RT_DFS_ELM_MAX_SECTOR_SIZE |
| 237 | +#else |
| 238 | +#define FF_MAX_SS 512 /* 512, 1024, 2048 or 4096 */ |
| 239 | +#endif |
210 | 240 | /* This set of options configures the range of sector size to be supported. (512, |
211 | 241 | / 1024, 2048 or 4096) Always set both 512 for most systems, generic memory card and |
212 | 242 | / harddisk, but a larger value may be required for on-board flash memory and some |
|
242 | 272 | / Instead of private sector buffer eliminated from the file object, common sector |
243 | 273 | / buffer in the filesystem object (FATFS) is used for the file data transfer. */ |
244 | 274 |
|
245 | | - |
246 | | -#define FF_FS_EXFAT 0 |
| 275 | +#ifdef RT_DFS_ELM_USE_EXFAT |
| 276 | +#define FF_FS_EXFAT 1 |
| 277 | +#else |
| 278 | +#define FF_FS_EXFAT 0 |
| 279 | +#endif |
247 | 280 | /* This option switches support for exFAT filesystem. (0:Disable or 1:Enable) |
248 | 281 | / To enable exFAT, also LFN needs to be enabled. (FF_USE_LFN >= 1) |
249 | 282 | / Note that enabling exFAT discards ANSI C (C89) compatibility. */ |
|
292 | 325 | / lock control is independent of re-entrancy. */ |
293 | 326 |
|
294 | 327 |
|
295 | | -#define FF_FS_REENTRANT 0 |
296 | | -#define FF_FS_TIMEOUT 1000 |
| 328 | +/* #include <somertos.h> // O/S definitions */ |
| 329 | +#include <rtdef.h> |
| 330 | +#ifdef RT_DFS_ELM_REENTRANT |
| 331 | +#define FF_FS_REENTRANT 1 /* 0 or 1 */ |
| 332 | +#else |
| 333 | +#define FF_FS_REENTRANT 0 /* 0:Disable or 1:Enable */ |
| 334 | +#endif |
| 335 | +#ifndef RT_DFS_ELM_MUTEX_TIMEOUT |
| 336 | +#define RT_DFS_ELM_MUTEX_TIMEOUT 3000 |
| 337 | +#endif |
| 338 | +#define FF_FS_TIMEOUT RT_DFS_ELM_MUTEX_TIMEOUT |
| 339 | +#define FF_SYNC_t rt_mutex_t |
297 | 340 | /* The option FF_FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs |
298 | 341 | / module itself. Note that regardless of this option, file access to different |
299 | 342 | / volume is always re-entrant and volume control functions, f_mount(), f_mkfs() |
|
0 commit comments