Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
mbed-os/features/filesystem/fat/ChaN/ffconf.h@0:02dd72d1d465, 2018-04-24 (annotated)
- Committer:
- borlanic
- Date:
- Tue Apr 24 11:45:18 2018 +0000
- Revision:
- 0:02dd72d1d465
BaBoRo_test2 - backup 1
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| borlanic | 0:02dd72d1d465 | 1 | /*---------------------------------------------------------------------------/ |
| borlanic | 0:02dd72d1d465 | 2 | / FatFs - Configuration file |
| borlanic | 0:02dd72d1d465 | 3 | /---------------------------------------------------------------------------*/ |
| borlanic | 0:02dd72d1d465 | 4 | |
| borlanic | 0:02dd72d1d465 | 5 | #define FFCONF_DEF 89352 /* Revision ID */ |
| borlanic | 0:02dd72d1d465 | 6 | |
| borlanic | 0:02dd72d1d465 | 7 | #define FFS_DBG 0 |
| borlanic | 0:02dd72d1d465 | 8 | |
| borlanic | 0:02dd72d1d465 | 9 | /*---------------------------------------------------------------------------/ |
| borlanic | 0:02dd72d1d465 | 10 | / Function Configurations |
| borlanic | 0:02dd72d1d465 | 11 | /---------------------------------------------------------------------------*/ |
| borlanic | 0:02dd72d1d465 | 12 | |
| borlanic | 0:02dd72d1d465 | 13 | #define FF_FS_READONLY 0 |
| borlanic | 0:02dd72d1d465 | 14 | /* This option switches read-only configuration. (0:Read/Write or 1:Read-only) |
| borlanic | 0:02dd72d1d465 | 15 | / Read-only configuration removes writing API functions, f_write(), f_sync(), |
| borlanic | 0:02dd72d1d465 | 16 | / f_unlink(), f_mkdir(), f_chmod(), f_rename(), f_truncate(), f_getfree() |
| borlanic | 0:02dd72d1d465 | 17 | / and optional writing functions as well. */ |
| borlanic | 0:02dd72d1d465 | 18 | |
| borlanic | 0:02dd72d1d465 | 19 | |
| borlanic | 0:02dd72d1d465 | 20 | #define FF_FS_MINIMIZE 0 |
| borlanic | 0:02dd72d1d465 | 21 | /* This option defines minimization level to remove some basic API functions. |
| borlanic | 0:02dd72d1d465 | 22 | / |
| borlanic | 0:02dd72d1d465 | 23 | / 0: Basic functions are fully enabled. |
| borlanic | 0:02dd72d1d465 | 24 | / 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_truncate() and f_rename() |
| borlanic | 0:02dd72d1d465 | 25 | / are removed. |
| borlanic | 0:02dd72d1d465 | 26 | / 2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1. |
| borlanic | 0:02dd72d1d465 | 27 | / 3: f_lseek() function is removed in addition to 2. */ |
| borlanic | 0:02dd72d1d465 | 28 | |
| borlanic | 0:02dd72d1d465 | 29 | |
| borlanic | 0:02dd72d1d465 | 30 | #define FF_USE_STRFUNC 0 |
| borlanic | 0:02dd72d1d465 | 31 | /* This option switches string functions, f_gets(), f_putc(), f_puts() and f_printf(). |
| borlanic | 0:02dd72d1d465 | 32 | / |
| borlanic | 0:02dd72d1d465 | 33 | / 0: Disable string functions. |
| borlanic | 0:02dd72d1d465 | 34 | / 1: Enable without LF-CRLF conversion. |
| borlanic | 0:02dd72d1d465 | 35 | / 2: Enable with LF-CRLF conversion. */ |
| borlanic | 0:02dd72d1d465 | 36 | |
| borlanic | 0:02dd72d1d465 | 37 | |
| borlanic | 0:02dd72d1d465 | 38 | #define FF_USE_FIND 0 |
| borlanic | 0:02dd72d1d465 | 39 | /* This option switches filtered directory read functions, f_findfirst() and |
| borlanic | 0:02dd72d1d465 | 40 | / f_findnext(). (0:Disable, 1:Enable 2:Enable with matching altname[] too) */ |
| borlanic | 0:02dd72d1d465 | 41 | |
| borlanic | 0:02dd72d1d465 | 42 | |
| borlanic | 0:02dd72d1d465 | 43 | #define FF_USE_MKFS 1 |
| borlanic | 0:02dd72d1d465 | 44 | /* This option switches f_mkfs() function. (0:Disable or 1:Enable) */ |
| borlanic | 0:02dd72d1d465 | 45 | |
| borlanic | 0:02dd72d1d465 | 46 | |
| borlanic | 0:02dd72d1d465 | 47 | #define FF_USE_FASTSEEK 0 |
| borlanic | 0:02dd72d1d465 | 48 | /* This option switches fast seek function. (0:Disable or 1:Enable) */ |
| borlanic | 0:02dd72d1d465 | 49 | |
| borlanic | 0:02dd72d1d465 | 50 | |
| borlanic | 0:02dd72d1d465 | 51 | #define FF_USE_EXPAND 0 |
| borlanic | 0:02dd72d1d465 | 52 | /* This option switches f_expand function. (0:Disable or 1:Enable) */ |
| borlanic | 0:02dd72d1d465 | 53 | |
| borlanic | 0:02dd72d1d465 | 54 | |
| borlanic | 0:02dd72d1d465 | 55 | #define FF_USE_CHMOD 0 |
| borlanic | 0:02dd72d1d465 | 56 | /* This option switches attribute manipulation functions, f_chmod() and f_utime(). |
| borlanic | 0:02dd72d1d465 | 57 | / (0:Disable or 1:Enable) Also FF_FS_READONLY needs to be 0 to enable this option. */ |
| borlanic | 0:02dd72d1d465 | 58 | |
| borlanic | 0:02dd72d1d465 | 59 | |
| borlanic | 0:02dd72d1d465 | 60 | #define FF_USE_LABEL 0 |
| borlanic | 0:02dd72d1d465 | 61 | /* This option switches volume label functions, f_getlabel() and f_setlabel(). |
| borlanic | 0:02dd72d1d465 | 62 | / (0:Disable or 1:Enable) */ |
| borlanic | 0:02dd72d1d465 | 63 | |
| borlanic | 0:02dd72d1d465 | 64 | |
| borlanic | 0:02dd72d1d465 | 65 | #define FF_USE_FORWARD 0 |
| borlanic | 0:02dd72d1d465 | 66 | /* This option switches f_forward() function. (0:Disable or 1:Enable) */ |
| borlanic | 0:02dd72d1d465 | 67 | |
| borlanic | 0:02dd72d1d465 | 68 | |
| borlanic | 0:02dd72d1d465 | 69 | /*---------------------------------------------------------------------------/ |
| borlanic | 0:02dd72d1d465 | 70 | / Locale and Namespace Configurations |
| borlanic | 0:02dd72d1d465 | 71 | /---------------------------------------------------------------------------*/ |
| borlanic | 0:02dd72d1d465 | 72 | |
| borlanic | 0:02dd72d1d465 | 73 | #define FF_CODE_PAGE 437 |
| borlanic | 0:02dd72d1d465 | 74 | /* This option specifies the OEM code page to be used on the target system. |
| borlanic | 0:02dd72d1d465 | 75 | / Incorrect code page setting can cause a file open failure. |
| borlanic | 0:02dd72d1d465 | 76 | / |
| borlanic | 0:02dd72d1d465 | 77 | / 437 - U.S. |
| borlanic | 0:02dd72d1d465 | 78 | / 720 - Arabic |
| borlanic | 0:02dd72d1d465 | 79 | / 737 - Greek |
| borlanic | 0:02dd72d1d465 | 80 | / 771 - KBL |
| borlanic | 0:02dd72d1d465 | 81 | / 775 - Baltic |
| borlanic | 0:02dd72d1d465 | 82 | / 850 - Latin 1 |
| borlanic | 0:02dd72d1d465 | 83 | / 852 - Latin 2 |
| borlanic | 0:02dd72d1d465 | 84 | / 855 - Cyrillic |
| borlanic | 0:02dd72d1d465 | 85 | / 857 - Turkish |
| borlanic | 0:02dd72d1d465 | 86 | / 860 - Portuguese |
| borlanic | 0:02dd72d1d465 | 87 | / 861 - Icelandic |
| borlanic | 0:02dd72d1d465 | 88 | / 862 - Hebrew |
| borlanic | 0:02dd72d1d465 | 89 | / 863 - Canadian French |
| borlanic | 0:02dd72d1d465 | 90 | / 864 - Arabic |
| borlanic | 0:02dd72d1d465 | 91 | / 865 - Nordic |
| borlanic | 0:02dd72d1d465 | 92 | / 866 - Russian |
| borlanic | 0:02dd72d1d465 | 93 | / 869 - Greek 2 |
| borlanic | 0:02dd72d1d465 | 94 | / 932 - Japanese (DBCS) |
| borlanic | 0:02dd72d1d465 | 95 | / 936 - Simplified Chinese (DBCS) |
| borlanic | 0:02dd72d1d465 | 96 | / 949 - Korean (DBCS) |
| borlanic | 0:02dd72d1d465 | 97 | / 950 - Traditional Chinese (DBCS) |
| borlanic | 0:02dd72d1d465 | 98 | / 0 - Include all code pages above and configured by f_setcp() |
| borlanic | 0:02dd72d1d465 | 99 | */ |
| borlanic | 0:02dd72d1d465 | 100 | |
| borlanic | 0:02dd72d1d465 | 101 | |
| borlanic | 0:02dd72d1d465 | 102 | #define FF_USE_LFN 3 |
| borlanic | 0:02dd72d1d465 | 103 | #define FF_MAX_LFN 255 |
| borlanic | 0:02dd72d1d465 | 104 | /* The FF_USE_LFN switches the support for LFN (long file name). |
| borlanic | 0:02dd72d1d465 | 105 | / |
| borlanic | 0:02dd72d1d465 | 106 | / 0: Disable LFN. FF_MAX_LFN has no effect. |
| borlanic | 0:02dd72d1d465 | 107 | / 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe. |
| borlanic | 0:02dd72d1d465 | 108 | / 2: Enable LFN with dynamic working buffer on the STACK. |
| borlanic | 0:02dd72d1d465 | 109 | / 3: Enable LFN with dynamic working buffer on the HEAP. |
| borlanic | 0:02dd72d1d465 | 110 | / |
| borlanic | 0:02dd72d1d465 | 111 | / To enable the LFN, ffunicode.c needs to be added to the project. The LFN function |
| borlanic | 0:02dd72d1d465 | 112 | / requiers certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and |
| borlanic | 0:02dd72d1d465 | 113 | / additional (FF_MAX_LFN + 44) / 15 * 32 bytes when exFAT is enabled. |
| borlanic | 0:02dd72d1d465 | 114 | / The FF_MAX_LFN defines size of the working buffer in UTF-16 code unit and it can |
| borlanic | 0:02dd72d1d465 | 115 | / be in range of 12 to 255. It is recommended to be set 255 to fully support LFN |
| borlanic | 0:02dd72d1d465 | 116 | / specification. |
| borlanic | 0:02dd72d1d465 | 117 | / When use stack for the working buffer, take care on stack overflow. When use heap |
| borlanic | 0:02dd72d1d465 | 118 | / memory for the working buffer, memory management functions, ff_memalloc() and |
| borlanic | 0:02dd72d1d465 | 119 | / ff_memfree() in ffsystem.c, need to be added to the project. */ |
| borlanic | 0:02dd72d1d465 | 120 | |
| borlanic | 0:02dd72d1d465 | 121 | |
| borlanic | 0:02dd72d1d465 | 122 | #define FF_LFN_UNICODE 0 |
| borlanic | 0:02dd72d1d465 | 123 | /* This option switches the character encoding on the API when LFN is enabled. |
| borlanic | 0:02dd72d1d465 | 124 | / |
| borlanic | 0:02dd72d1d465 | 125 | / 0: ANSI/OEM in current CP (TCHAR = char) |
| borlanic | 0:02dd72d1d465 | 126 | / 1: Unicode in UTF-16 (TCHAR = WCHAR) |
| borlanic | 0:02dd72d1d465 | 127 | / 2: Unicode in UTF-8 (TCHAR = char) |
| borlanic | 0:02dd72d1d465 | 128 | / |
| borlanic | 0:02dd72d1d465 | 129 | / Also behavior of string I/O functions will be affected by this option. |
| borlanic | 0:02dd72d1d465 | 130 | / When LFN is not enabled, this option has no effect. */ |
| borlanic | 0:02dd72d1d465 | 131 | |
| borlanic | 0:02dd72d1d465 | 132 | |
| borlanic | 0:02dd72d1d465 | 133 | #define FF_LFN_BUF 255 |
| borlanic | 0:02dd72d1d465 | 134 | #define FF_SFN_BUF 12 |
| borlanic | 0:02dd72d1d465 | 135 | /* This set of options defines size of file name members in the FILINFO structure |
| borlanic | 0:02dd72d1d465 | 136 | / which is used to read out directory items. These values should be suffcient for |
| borlanic | 0:02dd72d1d465 | 137 | / the file names to read. The maximum possible length of the read file name depends |
| borlanic | 0:02dd72d1d465 | 138 | / on character encoding. When LFN is not enabled, these options have no effect. */ |
| borlanic | 0:02dd72d1d465 | 139 | |
| borlanic | 0:02dd72d1d465 | 140 | |
| borlanic | 0:02dd72d1d465 | 141 | #define FF_STRF_ENCODE 3 |
| borlanic | 0:02dd72d1d465 | 142 | /* When FF_LFN_UNICODE >= 1 with LFN enabled, string I/O functions, f_gets(), |
| borlanic | 0:02dd72d1d465 | 143 | / f_putc(), f_puts and f_printf() convert the character encoding in it. |
| borlanic | 0:02dd72d1d465 | 144 | / This option selects assumption of character encoding ON THE FILE to be |
| borlanic | 0:02dd72d1d465 | 145 | / read/written via those functions. |
| borlanic | 0:02dd72d1d465 | 146 | / |
| borlanic | 0:02dd72d1d465 | 147 | / 0: ANSI/OEM in current CP |
| borlanic | 0:02dd72d1d465 | 148 | / 1: Unicode in UTF-16LE |
| borlanic | 0:02dd72d1d465 | 149 | / 2: Unicode in UTF-16BE |
| borlanic | 0:02dd72d1d465 | 150 | / 3: Unicode in UTF-8 |
| borlanic | 0:02dd72d1d465 | 151 | */ |
| borlanic | 0:02dd72d1d465 | 152 | |
| borlanic | 0:02dd72d1d465 | 153 | |
| borlanic | 0:02dd72d1d465 | 154 | #define FF_FS_RPATH 1 |
| borlanic | 0:02dd72d1d465 | 155 | /* This option configures support for relative path. |
| borlanic | 0:02dd72d1d465 | 156 | / |
| borlanic | 0:02dd72d1d465 | 157 | / 0: Disable relative path and remove related functions. |
| borlanic | 0:02dd72d1d465 | 158 | / 1: Enable relative path. f_chdir() and f_chdrive() are available. |
| borlanic | 0:02dd72d1d465 | 159 | / 2: f_getcwd() function is available in addition to 1. |
| borlanic | 0:02dd72d1d465 | 160 | */ |
| borlanic | 0:02dd72d1d465 | 161 | |
| borlanic | 0:02dd72d1d465 | 162 | |
| borlanic | 0:02dd72d1d465 | 163 | /*---------------------------------------------------------------------------/ |
| borlanic | 0:02dd72d1d465 | 164 | / Drive/Volume Configurations |
| borlanic | 0:02dd72d1d465 | 165 | /---------------------------------------------------------------------------*/ |
| borlanic | 0:02dd72d1d465 | 166 | |
| borlanic | 0:02dd72d1d465 | 167 | #define FF_VOLUMES 4 |
| borlanic | 0:02dd72d1d465 | 168 | /* Number of volumes (logical drives) to be used. (1-10) */ |
| borlanic | 0:02dd72d1d465 | 169 | |
| borlanic | 0:02dd72d1d465 | 170 | |
| borlanic | 0:02dd72d1d465 | 171 | #define FF_STR_VOLUME_ID 0 |
| borlanic | 0:02dd72d1d465 | 172 | #define FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3" |
| borlanic | 0:02dd72d1d465 | 173 | /* FF_STR_VOLUME_ID switches string support for volume ID. |
| borlanic | 0:02dd72d1d465 | 174 | / When FF_STR_VOLUME_ID is set to 1, also pre-defined strings can be used as drive |
| borlanic | 0:02dd72d1d465 | 175 | / number in the path name. FF_VOLUME_STRS defines the drive ID strings for each |
| borlanic | 0:02dd72d1d465 | 176 | / logical drives. Number of items must be equal to FF_VOLUMES. Valid characters for |
| borlanic | 0:02dd72d1d465 | 177 | / the drive ID strings are: A-Z and 0-9. */ |
| borlanic | 0:02dd72d1d465 | 178 | |
| borlanic | 0:02dd72d1d465 | 179 | |
| borlanic | 0:02dd72d1d465 | 180 | #define FF_MULTI_PARTITION 0 |
| borlanic | 0:02dd72d1d465 | 181 | /* This option switches support for multiple volumes on the physical drive. |
| borlanic | 0:02dd72d1d465 | 182 | / By default (0), each logical drive number is bound to the same physical drive |
| borlanic | 0:02dd72d1d465 | 183 | / number and only an FAT volume found on the physical drive will be mounted. |
| borlanic | 0:02dd72d1d465 | 184 | / When this function is enabled (1), each logical drive number can be bound to |
| borlanic | 0:02dd72d1d465 | 185 | / arbitrary physical drive and partition listed in the VolToPart[]. Also f_fdisk() |
| borlanic | 0:02dd72d1d465 | 186 | / funciton will be available. */ |
| borlanic | 0:02dd72d1d465 | 187 | |
| borlanic | 0:02dd72d1d465 | 188 | |
| borlanic | 0:02dd72d1d465 | 189 | #define FF_MIN_SS 512 |
| borlanic | 0:02dd72d1d465 | 190 | #define FF_MAX_SS 4096 |
| borlanic | 0:02dd72d1d465 | 191 | /* This set of options configures the range of sector size to be supported. (512, |
| borlanic | 0:02dd72d1d465 | 192 | / 1024, 2048 or 4096) Always set both 512 for most systems, generic memory card and |
| borlanic | 0:02dd72d1d465 | 193 | / harddisk. But a larger value may be required for on-board flash memory and some |
| borlanic | 0:02dd72d1d465 | 194 | / type of optical media. When FF_MAX_SS is larger than FF_MIN_SS, FatFs is configured |
| borlanic | 0:02dd72d1d465 | 195 | / for variable sector size mode and disk_ioctl() function needs to implement |
| borlanic | 0:02dd72d1d465 | 196 | / GET_SECTOR_SIZE command. */ |
| borlanic | 0:02dd72d1d465 | 197 | |
| borlanic | 0:02dd72d1d465 | 198 | |
| borlanic | 0:02dd72d1d465 | 199 | #define FF_USE_TRIM 1 |
| borlanic | 0:02dd72d1d465 | 200 | /* This option switches support for ATA-TRIM. (0:Disable or 1:Enable) |
| borlanic | 0:02dd72d1d465 | 201 | / To enable Trim function, also CTRL_TRIM command should be implemented to the |
| borlanic | 0:02dd72d1d465 | 202 | / disk_ioctl() function. */ |
| borlanic | 0:02dd72d1d465 | 203 | |
| borlanic | 0:02dd72d1d465 | 204 | |
| borlanic | 0:02dd72d1d465 | 205 | #define FF_FS_NOFSINFO 0 |
| borlanic | 0:02dd72d1d465 | 206 | /* If you need to know correct free space on the FAT32 volume, set bit 0 of this |
| borlanic | 0:02dd72d1d465 | 207 | / option, and f_getfree() function at first time after volume mount will force |
| borlanic | 0:02dd72d1d465 | 208 | / a full FAT scan. Bit 1 controls the use of last allocated cluster number. |
| borlanic | 0:02dd72d1d465 | 209 | / |
| borlanic | 0:02dd72d1d465 | 210 | / bit0=0: Use free cluster count in the FSINFO if available. |
| borlanic | 0:02dd72d1d465 | 211 | / bit0=1: Do not trust free cluster count in the FSINFO. |
| borlanic | 0:02dd72d1d465 | 212 | / bit1=0: Use last allocated cluster number in the FSINFO if available. |
| borlanic | 0:02dd72d1d465 | 213 | / bit1=1: Do not trust last allocated cluster number in the FSINFO. |
| borlanic | 0:02dd72d1d465 | 214 | */ |
| borlanic | 0:02dd72d1d465 | 215 | |
| borlanic | 0:02dd72d1d465 | 216 | |
| borlanic | 0:02dd72d1d465 | 217 | |
| borlanic | 0:02dd72d1d465 | 218 | /*---------------------------------------------------------------------------/ |
| borlanic | 0:02dd72d1d465 | 219 | / System Configurations |
| borlanic | 0:02dd72d1d465 | 220 | /---------------------------------------------------------------------------*/ |
| borlanic | 0:02dd72d1d465 | 221 | |
| borlanic | 0:02dd72d1d465 | 222 | #define FF_FS_TINY 1 |
| borlanic | 0:02dd72d1d465 | 223 | /* This option switches tiny buffer configuration. (0:Normal or 1:Tiny) |
| borlanic | 0:02dd72d1d465 | 224 | / At the tiny configuration, size of file object (FIL) is shrinked FF_MAX_SS bytes. |
| borlanic | 0:02dd72d1d465 | 225 | / Instead of private sector buffer eliminated from the file object, common sector |
| borlanic | 0:02dd72d1d465 | 226 | / buffer in the filesystem object (FATFS) is used for the file data transfer. */ |
| borlanic | 0:02dd72d1d465 | 227 | |
| borlanic | 0:02dd72d1d465 | 228 | |
| borlanic | 0:02dd72d1d465 | 229 | #define FF_FS_EXFAT 0 |
| borlanic | 0:02dd72d1d465 | 230 | /* This option switches support for exFAT filesystem. (0:Disable or 1:Enable) |
| borlanic | 0:02dd72d1d465 | 231 | / When enable exFAT, also LFN needs to be enabled. |
| borlanic | 0:02dd72d1d465 | 232 | / Note that enabling exFAT discards ANSI C (C89) compatibility. */ |
| borlanic | 0:02dd72d1d465 | 233 | |
| borlanic | 0:02dd72d1d465 | 234 | |
| borlanic | 0:02dd72d1d465 | 235 | #define FF_FS_HEAPBUF 1 |
| borlanic | 0:02dd72d1d465 | 236 | /* This option enables the use of the heap for allocating buffers. Otherwise |
| borlanic | 0:02dd72d1d465 | 237 | / _MAX_SS sized buffers are allocated statically in relevant structures (in |
| borlanic | 0:02dd72d1d465 | 238 | / FATFS if _FS_TINY, otherwise in FATFS and FIL) |
| borlanic | 0:02dd72d1d465 | 239 | / This option allows the filesystem to dynamically allocate the buffers based |
| borlanic | 0:02dd72d1d465 | 240 | / on underlying sector size. */ |
| borlanic | 0:02dd72d1d465 | 241 | |
| borlanic | 0:02dd72d1d465 | 242 | |
| borlanic | 0:02dd72d1d465 | 243 | #define FF_FS_NORTC 0 |
| borlanic | 0:02dd72d1d465 | 244 | #define FF_NORTC_MON 1 |
| borlanic | 0:02dd72d1d465 | 245 | #define FF_NORTC_MDAY 1 |
| borlanic | 0:02dd72d1d465 | 246 | #define FF_NORTC_YEAR 2017 |
| borlanic | 0:02dd72d1d465 | 247 | /* The option FF_FS_NORTC switches timestamp functiton. If the system does not have |
| borlanic | 0:02dd72d1d465 | 248 | / any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable |
| borlanic | 0:02dd72d1d465 | 249 | / the timestamp function. All objects modified by FatFs will have a fixed timestamp |
| borlanic | 0:02dd72d1d465 | 250 | / defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR in local time. |
| borlanic | 0:02dd72d1d465 | 251 | / To enable timestamp function (FF_FS_NORTC = 0), get_fattime() function need to be |
| borlanic | 0:02dd72d1d465 | 252 | / added to the project to read current time form real-time clock. FF_NORTC_MON, |
| borlanic | 0:02dd72d1d465 | 253 | / FF_NORTC_MDAY and FF_NORTC_YEAR have no effect. |
| borlanic | 0:02dd72d1d465 | 254 | / These options have no effect at read-only configuration (FF_FS_READONLY = 1). */ |
| borlanic | 0:02dd72d1d465 | 255 | |
| borlanic | 0:02dd72d1d465 | 256 | |
| borlanic | 0:02dd72d1d465 | 257 | #define FF_FS_LOCK 0 |
| borlanic | 0:02dd72d1d465 | 258 | /* The option FF_FS_LOCK switches file lock function to control duplicated file open |
| borlanic | 0:02dd72d1d465 | 259 | / and illegal operation to open objects. This option must be 0 when FF_FS_READONLY |
| borlanic | 0:02dd72d1d465 | 260 | / is 1. |
| borlanic | 0:02dd72d1d465 | 261 | / |
| borlanic | 0:02dd72d1d465 | 262 | / 0: Disable file lock function. To avoid volume corruption, application program |
| borlanic | 0:02dd72d1d465 | 263 | / should avoid illegal open, remove and rename to the open objects. |
| borlanic | 0:02dd72d1d465 | 264 | / >0: Enable file lock function. The value defines how many files/sub-directories |
| borlanic | 0:02dd72d1d465 | 265 | / can be opened simultaneously under file lock control. Note that the file |
| borlanic | 0:02dd72d1d465 | 266 | / lock control is independent of re-entrancy. */ |
| borlanic | 0:02dd72d1d465 | 267 | |
| borlanic | 0:02dd72d1d465 | 268 | |
| borlanic | 0:02dd72d1d465 | 269 | #define FF_FS_REENTRANT 0 |
| borlanic | 0:02dd72d1d465 | 270 | #define FF_FS_TIMEOUT 1000 |
| borlanic | 0:02dd72d1d465 | 271 | #define FF_SYNC_t HANDLE |
| borlanic | 0:02dd72d1d465 | 272 | /* The option FF_FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs |
| borlanic | 0:02dd72d1d465 | 273 | / module itself. Note that regardless of this option, file access to different |
| borlanic | 0:02dd72d1d465 | 274 | / volume is always re-entrant and volume control functions, f_mount(), f_mkfs() |
| borlanic | 0:02dd72d1d465 | 275 | / and f_fdisk() function, are always not re-entrant. Only file/directory access |
| borlanic | 0:02dd72d1d465 | 276 | / to the same volume is under control of this function. |
| borlanic | 0:02dd72d1d465 | 277 | / |
| borlanic | 0:02dd72d1d465 | 278 | / 0: Disable re-entrancy. FF_FS_TIMEOUT and FF_SYNC_t have no effect. |
| borlanic | 0:02dd72d1d465 | 279 | / 1: Enable re-entrancy. Also user provided synchronization handlers, |
| borlanic | 0:02dd72d1d465 | 280 | / ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj() |
| borlanic | 0:02dd72d1d465 | 281 | / function, must be added to the project. Samples are available in |
| borlanic | 0:02dd72d1d465 | 282 | / option/syscall.c. |
| borlanic | 0:02dd72d1d465 | 283 | / |
| borlanic | 0:02dd72d1d465 | 284 | / The FF_FS_TIMEOUT defines timeout period in unit of time tick. |
| borlanic | 0:02dd72d1d465 | 285 | / The FF_SYNC_t defines O/S dependent sync object type. e.g. HANDLE, ID, OS_EVENT*, |
| borlanic | 0:02dd72d1d465 | 286 | / SemaphoreHandle_t and etc. A header file for O/S definitions needs to be |
| borlanic | 0:02dd72d1d465 | 287 | / included somewhere in the scope of ff.h. */ |
| borlanic | 0:02dd72d1d465 | 288 | |
| borlanic | 0:02dd72d1d465 | 289 | /* #include <windows.h> // O/S definitions */ |
| borlanic | 0:02dd72d1d465 | 290 | |
| borlanic | 0:02dd72d1d465 | 291 | #define FLUSH_ON_NEW_CLUSTER 0 /* Sync the file on every new cluster */ |
| borlanic | 0:02dd72d1d465 | 292 | #define FLUSH_ON_NEW_SECTOR 1 /* Sync the file on every new sector */ |
| borlanic | 0:02dd72d1d465 | 293 | /* Only one of these two defines needs to be set to 1. If both are set to 0 |
| borlanic | 0:02dd72d1d465 | 294 | the file is only sync when closed. |
| borlanic | 0:02dd72d1d465 | 295 | Clusters are group of sectors (eg: 8 sectors). Flushing on new cluster means |
| borlanic | 0:02dd72d1d465 | 296 | it would be less often than flushing on new sector. Sectors are generally |
| borlanic | 0:02dd72d1d465 | 297 | 512 Bytes long. */ |
| borlanic | 0:02dd72d1d465 | 298 | |
| borlanic | 0:02dd72d1d465 | 299 | |
| borlanic | 0:02dd72d1d465 | 300 | /*--- End of configuration options ---*/ |