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