]> git.sur5r.net Git - freertos/blob - FreeRTOS-Labs/Demo/FreeRTOS_Plus_TCP_and_FAT_Windows_Simulator/FreeRTOSFATConfig.h
Add the Labs projects provided in the V10.2.1_191129 zip file.
[freertos] / FreeRTOS-Labs / Demo / FreeRTOS_Plus_TCP_and_FAT_Windows_Simulator / FreeRTOSFATConfig.h
1 /*\r
2     FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.\r
3     All rights reserved\r
4 \r
5     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
6 \r
7     This file is part of the FreeRTOS distribution.\r
8 \r
9     FreeRTOS is free software; you can redistribute it and/or modify it under\r
10     the terms of the GNU General Public License (version 2) as published by the\r
11     Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
12 \r
13     ***************************************************************************\r
14     >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
15     >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
16     >>!   obliged to provide the source code for proprietary components     !<<\r
17     >>!   outside of the FreeRTOS kernel.                                   !<<\r
18     ***************************************************************************\r
19 \r
20     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
21     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
22     FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
23     link: http://www.freertos.org/a00114.html\r
24 \r
25     ***************************************************************************\r
26      *                                                                       *\r
27      *    FreeRTOS provides completely free yet professionally developed,    *\r
28      *    robust, strictly quality controlled, supported, and cross          *\r
29      *    platform software that is more than just the market leader, it     *\r
30      *    is the industry's de facto standard.                               *\r
31      *                                                                       *\r
32      *    Help yourself get started quickly while simultaneously helping     *\r
33      *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
34      *    tutorial book, reference manual, or both:                          *\r
35      *    http://www.FreeRTOS.org/Documentation                              *\r
36      *                                                                       *\r
37     ***************************************************************************\r
38 \r
39     http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
40     the FAQ page "My application does not run, what could be wrong?".  Have you\r
41     defined configASSERT()?\r
42 \r
43     http://www.FreeRTOS.org/support - In return for receiving this top quality\r
44     embedded software for free we request you assist our global community by\r
45     participating in the support forum.\r
46 \r
47     http://www.FreeRTOS.org/training - Investing in training allows your team to\r
48     be as productive as possible as early as possible.  Now you can receive\r
49     FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
50     Ltd, and the world's leading authority on the world's leading RTOS.\r
51 \r
52     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
53     including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
54     compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
55 \r
56     http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
57     Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
58 \r
59     http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
60     Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
61     licenses offer ticketed support, indemnification and commercial middleware.\r
62 \r
63     http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
64     engineered and independently SIL3 certified version for use in safety and\r
65     mission critical applications that require provable dependability.\r
66 \r
67     1 tab == 4 spaces!\r
68 */\r
69 \r
70 #ifndef _FF_CONFIG_H_\r
71 #define _FF_CONFIG_H_\r
72 \r
73 /* Must be set to either pdFREERTOS_LITTLE_ENDIAN or pdFREERTOS_BIG_ENDIAN,\r
74 depending on the endian of the architecture on which FreeRTOS is running. */\r
75 #define ffconfigBYTE_ORDER pdFREERTOS_LITTLE_ENDIAN\r
76 \r
77 /* Set to 1 to maintain a current working directory (CWD) for each task that\r
78 accesses the file system, allowing relative paths to be used.\r
79 \r
80 Set to 0 not to use a CWD, in which case full paths must be used for each\r
81 file access. */\r
82 #define ffconfigHAS_CWD 1\r
83 \r
84 /* Set to an index within FreeRTOS's thread local storage array that is free for\r
85 use by FreeRTOS+FAT.  FreeRTOS+FAT will use two consecutive indexes from this\r
86 that set by ffconfigCWD_THREAD_LOCAL_INDEX.  The number of thread local storage\r
87 pointers provided by FreeRTOS is set by configNUM_THREAD_LOCAL_STORAGE_POINTERS\r
88 in FreeRTOSConfig.h */\r
89 #define ffconfigCWD_THREAD_LOCAL_INDEX 0\r
90 \r
91 /* Set to 1 to include long file name support.  Set to 0 to exclude long\r
92 file name support.\r
93 \r
94 If long file name support is excluded then only 8.3 file names can be used.\r
95 Long file names will be recognised but ignored.\r
96 \r
97 Users should familiarise themselves with any patent issues that may\r
98 potentially exist around the use of long file names in FAT file systems\r
99 before enabling long file name support. */\r
100 #define ffconfigLFN_SUPPORT 1\r
101 \r
102 /* Only used when ffconfigLFN_SUPPORT is set to 1.\r
103 \r
104 Set to 1 to include a file's short name when listing a directory, i.e. when\r
105 calling findfirst()/findnext().  The short name will be stored in the\r
106 'pcShortName' field of FF_DirEnt_t.\r
107 \r
108 Set to 0 to only include a file's long name. */\r
109 #define ffconfigINCLUDE_SHORT_NAME 0\r
110 \r
111 /* Set to 1 to recognise and apply the case bits used by Windows XP+ when\r
112 using short file names - storing file names such as "readme.TXT" or\r
113 "SETUP.exe" in a short-name entry.  This is the recommended setting for\r
114 maximum compatibility.\r
115 \r
116 Set to 0 to ignore the case bits. */\r
117 #define ffconfigSHORTNAME_CASE 1\r
118 \r
119 /* Only used when ffconfigLFN_SUPPORT is set to 1.\r
120 \r
121 Set to 1 to use UTF-16 (wide-characters) for file and directory names.\r
122 \r
123 Set to 0 to use either 8-bit ASCII or UTF-8 for file and directory names\r
124 (see the ffconfigUNICODE_UTF8_SUPPORT). */\r
125 #define ffconfigUNICODE_UTF16_SUPPORT 0\r
126 \r
127 /* Only used when ffconfigLFN_SUPPORT is set to 1.\r
128 \r
129 Set to 1 to use UTF-8 encoding for file and directory names.\r
130 \r
131 Set to 0 to use either 8-bit ASCII or UTF-16 for file and directory\r
132 names (see the ffconfig_UTF_16_SUPPORT setting). */\r
133 #define ffconfigUNICODE_UTF8_SUPPORT 0\r
134 \r
135 /* Set to 1 to include FAT12 support.\r
136 \r
137 Set to 0 to exclude FAT12 support.\r
138 \r
139 FAT16 and FAT32 are always enabled. */\r
140 #define ffconfigFAT12_SUPPORT 0\r
141 \r
142 /* When writing and reading data, i/o becomes less efficient if sizes other\r
143 than 512 bytes are being used.  When set to 1 each file handle will\r
144 allocate a 512-byte character buffer to facilitate "unaligned access". */\r
145 #define ffconfigOPTIMISE_UNALIGNED_ACCESS       1\r
146 \r
147 /* Input and output to a disk uses buffers that are only flushed at the\r
148 following times:\r
149 \r
150 - When a new buffer is needed and no other buffers are available.\r
151 - When opening a buffer in READ mode for a sector that has just been changed.\r
152 - After creating, removing or closing a file or a directory.\r
153 \r
154 Normally this is quick enough and it is efficient.  If\r
155 ffconfigCACHE_WRITE_THROUGH is set to 1 then buffers will also be flushed each\r
156 time a buffer is released - which is less efficient but more secure. */\r
157 #define ffconfigCACHE_WRITE_THROUGH     1\r
158 \r
159 /* In most cases, the FAT table has two identical copies on the disk,\r
160 allowing the second copy to be used in the case of a read error.  If\r
161 \r
162 Set to 1 to use both FATs - this is less efficient but more     secure.\r
163 \r
164 Set to 0 to use only one FAT - the second FAT will never be written to. */\r
165 #define ffconfigWRITE_BOTH_FATS 1\r
166 \r
167 /* Set to 1 to have the number of free clusters and the first free cluster\r
168 to be written to the FS info sector each time one of those values changes.\r
169 \r
170 Set to 0 not to store these values in the FS info sector, making booting\r
171 slower, but making changes faster. */\r
172 #define ffconfigWRITE_FREE_COUNT 1\r
173 \r
174 /* Set to 1 to maintain file and directory time stamps for creation, modify\r
175 and last access.\r
176 \r
177 Set to 0 to exclude     time stamps.\r
178 \r
179 If time support is used, the following function must be supplied:\r
180 \r
181         time_t FreeRTOS_time( time_t *pxTime );\r
182 \r
183 FreeRTOS_time has the same semantics as the standard time() function. */\r
184 #define ffconfigTIME_SUPPORT 1\r
185 \r
186 /* Set to 1 if the media is removable (such as a memory card).\r
187 \r
188 Set to 0 if the media is not removable.\r
189 \r
190 When set to 1 all file handles will be "invalidated" if the media is\r
191 extracted.  If set to 0 then file handles will not be invalidated.\r
192 In that case the user will have to confirm that the media is still present\r
193 before every access. */\r
194 #define ffconfigREMOVABLE_MEDIA 0\r
195 \r
196 /* Set to 1 to determine the disk's free space and the disk's first free\r
197 cluster when a disk is mounted.\r
198 \r
199 Set to 0 to find these two values when they     are first needed.  Determining\r
200 the values can take some time. */\r
201 #define ffconfigMOUNT_FIND_FREE 1\r
202 \r
203 /* Set to 1 to 'trust' the contents of the 'ulLastFreeCluster' and\r
204 ulFreeClusterCount fields.\r
205 \r
206 Set to 0 not to 'trust' these fields.*/\r
207 #define ffconfigFSINFO_TRUSTED 1\r
208 \r
209 /* Set to 1 to store recent paths in a cache, enabling much faster access\r
210 when the path is deep within a directory structure at the expense of\r
211 additional RAM usage.\r
212 \r
213 Set to 0 to not use a path cache. */\r
214 #define ffconfigPATH_CACHE 1\r
215 \r
216 /* Only used if ffconfigPATH_CACHE is 1.\r
217 \r
218 Sets the maximum number of paths that can exist in the patch cache at any\r
219 one time. */\r
220 #define ffconfigPATH_CACHE_DEPTH 8\r
221 \r
222 /* Set to 1 to calculate a HASH value for each existing short file name.\r
223 Use of HASH values can improve performance when working with large\r
224 directories, or with files that have a similar name.\r
225 \r
226 Set to 0 not to calculate a HASH value. */\r
227 #define ffconfigHASH_CACHE      1\r
228 \r
229 /* Only used if ffconfigHASH_CACHE is set to 1\r
230 \r
231 Set to CRC8 or CRC16 to use 8-bit or 16-bit HASH values respectively. */\r
232 #define ffconfigHASH_FUNCTION CRC16\r
233 \r
234 /*_RB_ Not in FreeRTOSFFConfigDefaults.h. */\r
235 #define ffconfigHASH_CACHE_DEPTH 64\r
236 \r
237 /* Set to 1 to add a parameter to ff_mkdir() that allows an entire directory\r
238 tree to be created in one go, rather than having to create one directory in\r
239 the tree at a time.  For example mkdir( "/etc/settings/network", pdTRUE );.\r
240 \r
241 Set to 0 to use the normal mkdir() semantics (without the additional\r
242 parameter). */\r
243 #define ffconfigMKDIR_RECURSIVE  0\r
244 \r
245 /* Set to a function that will be used for all dynamic memory allocations.\r
246 Setting to pvPortMalloc() will use the same memory allocator as FreeRTOS. */\r
247 #define ffconfigMALLOC( size )  pvPortMalloc( size )\r
248 \r
249 /* Set to a function that matches the above allocator defined with\r
250 ffconfigMALLOC.  Setting to vPortFree() will use the same memory free\r
251 function as     FreeRTOS. */\r
252 #define ffconfigFREE( ptr )  vPortFree( ptr )\r
253 \r
254 /* Set to 1 to calculate the free size and volume size as a 64-bit number.\r
255 \r
256 Set to 0 to calculate these values as a 32-bit number. */\r
257 #define ffconfig64_NUM_SUPPORT  0\r
258 \r
259 /* Defines the maximum number of partitions (and also logical partitions)\r
260 that can be recognised. */\r
261 #define ffconfigMAX_PARTITIONS 1\r
262 \r
263 /* Defines how many drives can be combined in total.  Should be set to at\r
264 least 2. */\r
265 #define ffconfigMAX_FILE_SYS 2\r
266 \r
267 /* In case the low-level driver returns an error 'FF_ERR_DRIVER_BUSY',\r
268 the library will pause for a number of ms, defined in\r
269 ffconfigDRIVER_BUSY_SLEEP_MS before re-trying. */\r
270 #define ffconfigDRIVER_BUSY_SLEEP_MS 20\r
271 \r
272 /* Set to 1 to include the ff_fprintf() function.\r
273 \r
274 Set to 0 to exclude the ff_fprintf() function.\r
275 \r
276 ff_fprintf() is quite a heavy function because it allocates RAM and\r
277 brings in a lot of string and variable argument handling code.  If\r
278 ff_fprintf() is not being used then the code size can be reduced by setting\r
279 ffconfigFPRINTF_SUPPORT to 0. */\r
280 #define ffconfigFPRINTF_SUPPORT 1\r
281 \r
282 /* ff_fprintf() will allocate a buffer of this size in which it will create\r
283 its formatted string.  The buffer will be freed before the function\r
284 exits. */\r
285 #define ffconfigFPRINTF_BUFFER_LENGTH 128\r
286 \r
287 /* Set to 1 to inline some internal memory access functions.\r
288 \r
289 Set to 0 to not inline the memory access functions. */\r
290 #define ffconfigINLINE_MEMORY_ACCESS            1\r
291 \r
292 /* Officially the only criteria to determine the FAT type (12, 16, or 32\r
293 bits) is the total number of clusters:\r
294 if( ulNumberOfClusters  <  4085 ) : Volume is FAT12\r
295 if( ulNumberOfClusters  < 65525 ) : Volume is FAT16\r
296 if( ulNumberOfClusters >= 65525 ) : Volume is FAT32\r
297 Not every formatted device follows the above rule.\r
298 \r
299 Set to 1 to perform additional checks over and above inspecting the\r
300 number of clusters on a disk to determine the FAT type.\r
301 \r
302 Set to 0 to only look at the number of clusters on a disk to determine the\r
303 FAT type. */\r
304 #define ffconfigFAT_CHECK 1\r
305 \r
306 /* Sets the maximum length for file names, including the path.\r
307 Note that the value of this define is directly related to the maximum stack\r
308 use of the +FAT library. In some API's, a character buffer of size\r
309 'ffconfigMAX_FILENAME' will be declared on stack. */\r
310 #define ffconfigMAX_FILENAME 250\r
311 \r
312 /* Defined in main.c as Visual Studio does not provide its own implementation. */\r
313 struct tm *gmtime_r( const time_t *pxTime, struct tm *tmStruct );\r
314 \r
315 /* Prototype for the function used to print out.  In this case it prints to the\r
316 console before the network is connected then a UDP port after the network has\r
317 connected. */\r
318 extern void vLoggingPrintf( const char *pcFormatString, ... );\r
319 #define FF_PRINTF vLoggingPrintf\r
320 \r
321 /* Visual studio does not have an implementation of strcasecmp().\r
322 _RB_ Cannot use FF_NOSTRCASECMP setting as the internal implementation of\r
323 strcasecmp() is in ff_dir, whereas it is used in the http server.   Also not\r
324 sure of why FF_NOSTRCASECMP is being tested against 0 to define the internal\r
325 implementation, so I have to set it to 1 here, so it is not defined. */\r
326 #define FF_NOSTRCASECMP 1\r
327 \r
328 /* Include the recursive function ff_deltree().  The use of recursion does not\r
329 conform with the coding standard, so use this function with care! */\r
330 #define ffconfigUSE_DELTREE                                     1\r
331 \r
332 #endif /* _FF_CONFIG_H_ */\r
333 \r