1 /***************************************************************************
2  * Copyright (c) 2024 Microsoft Corporation
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the MIT License which is available at
6  * https://opensource.org/licenses/MIT.
7  *
8  * SPDX-License-Identifier: MIT
9  **************************************************************************/
10 
11 
12 /**************************************************************************/
13 /**************************************************************************/
14 /**                                                                       */
15 /** FileX Component                                                       */
16 /**                                                                       */
17 /**   User Specific                                                       */
18 /**                                                                       */
19 /**************************************************************************/
20 /**************************************************************************/
21 
22 
23 /**************************************************************************/
24 /*                                                                        */
25 /*  PORT SPECIFIC C INFORMATION                            RELEASE        */
26 /*                                                                        */
27 /*    fx_user.h                                           PORTABLE C      */
28 /*                                                           6.1.5        */
29 /*                                                                        */
30 /*  AUTHOR                                                                */
31 /*                                                                        */
32 /*    William E. Lamie, Microsoft Corporation                             */
33 /*                                                                        */
34 /*  DESCRIPTION                                                           */
35 /*                                                                        */
36 /*    This file contains user defines for configuring FileX in specific   */
37 /*    ways. This file will have an effect only if the application and     */
38 /*    FileX library are built with FX_INCLUDE_USER_DEFINE_FILE defined.   */
39 /*    Note that all the defines in this file may also be made on the      */
40 /*    command line when building FileX library and application objects.   */
41 /*                                                                        */
42 /*  RELEASE HISTORY                                                       */
43 /*                                                                        */
44 /*    DATE              NAME                      DESCRIPTION             */
45 /*                                                                        */
46 /*  05-19-2020     William E. Lamie         Initial Version 6.0           */
47 /*  09-30-2020     William E. Lamie         Modified comment(s), and      */
48 /*                                            added product constants     */
49 /*                                            to enable code              */
50 /*                                            size optimization,          */
51 /*                                            resulting in version 6.1    */
52 /*  03-02-2021     William E. Lamie         Modified comment(s), and      */
53 /*                                            added standalone support,   */
54 /*                                            resulting in version 6.1.5  */
55 /*                                                                        */
56 /**************************************************************************/
57 
58 #ifndef FX_USER_H
59 #define FX_USER_H
60 
61 
62 /* Define various build options for the FileX port.  The application should either make changes
63    here by commenting or un-commenting the conditional compilation defined OR supply the defines
64    though the compiler's equivalent of the -D option.  */
65 
66 
67 /* Override various options with default values already assigned in fx_api.h or fx_port.h. Please
68    also refer to fx_port.h for descriptions on each of these options.  */
69 
70 
71 /* Defines the maximum size of long file names supported by FileX. The default value is 33. The
72    minimum value is 13 and the maximum value is 256.  */
73 
74 /*#define FX_MAX_LONG_NAME_LEN            256   */
75 /*#define FX_MAX_LAST_NAME_LEN            256   */      /* Must be as large or larger than FX_MAX_LONG_NAME_LEN */
76 
77 
78 /* Defines the maximum number of logical sectors that can be cached by FileX. The cache memory
79    supplied to FileX at fx_media_open determines how many sectors can actually be cached.  */
80 
81 /*#define FX_MAX_SECTOR_CACHE             256   */      /* Minimum value is 2, all other values must be power of 2.  */
82 
83 
84 /* Defines the size in bytes of the bit map used to update the secondary FAT sectors. The larger the value the
85    less unnecessary secondary FAT sector writes.   */
86 
87 /*#define FX_FAT_MAP_SIZE                 128  */       /* Minimum value is 1, no maximum value.  */
88 
89 
90 /* Defines the number of entries in the FAT cache.  */
91 
92 /*#define FX_MAX_FAT_CACHE                16   */       /* Minimum value is 8, all values must be a power of 2.  */
93 
94 
95 /* Defines the number of seconds the time parameters are updated in FileX.  */
96 
97 /*#define FX_UPDATE_RATE_IN_SECONDS       10   */
98 
99 
100 /* Defines the number of ThreadX timer ticks required to achieve the update rate specified by
101    FX_UPDATE_RATE_IN_SECONDS defined previously. By default, the ThreadX timer tick is 10ms,
102    so the default value for this constant is 1000.  */
103 
104 /*#define FX_UPDATE_RATE_IN_TICKS         1000 */
105 
106 
107 /* Defined, FileX is built without update to the time parameters.  */
108 
109 /*#define FX_NO_TIMER  */
110 
111 
112 /* Defined, FileX does not update already opened files.  */
113 
114 /*#define FX_DONT_UPDATE_OPEN_FILES   */
115 
116 
117 /* Defined, the file search cache optimization is disabled.  */
118 
119 /*#define FX_MEDIA_DISABLE_SEARCH_CACHE  */
120 
121 
122 /* Defined, the direct read sector update of cache is disabled.  */
123 
124 /*#define FX_DISABLE_DIRECT_DATA_READ_CACHE_FILL  */
125 
126 
127 /* Defined, gathering of media statistics is disabled.  */
128 
129 /*#define FX_MEDIA_STATISTICS_DISABLE  */
130 
131 
132 /* Defined, legacy single open logic for the same file is enabled.  */
133 
134 /*#define FX_SINGLE_OPEN_LEGACY   */
135 
136 
137 /* Defined, renaming inherits path information.  */
138 
139 /*#define FX_RENAME_PATH_INHERIT   */
140 
141 
142 /* Defined, local path logic is disabled.  */
143 
144 /*#define FX_NO_LOCAL_PATH   */
145 
146 
147 /* Define FileX internal protection macros.  If FX_SINGLE_THREAD is defined,
148    these protection macros are effectively disabled.  However, for multi-thread
149    uses, the macros are setup to utilize a ThreadX mutex for multiple thread
150    access control into an open media.  */
151 
152 /* #define FX_SINGLE_THREAD   */
153 
154 
155 /* Defined, Filex will be used in standalone mode (without ThreadX) */
156 
157 /* #define FX_STANDALONE_ENABLE */
158 
159 
160 /* Defined, data sector write requests are flushed immediately to the driver.  */
161 
162 /*#define FX_FAULT_TOLERANT_DATA  */
163 
164 
165 /* Defined, system sector write requests (including FAT and directory entry requests)
166    are flushed immediately to the driver.  */
167 
168 /*#define FX_FAULT_TOLERANT   */
169 
170 
171 /* Defined, enables 64-bits sector addresses used in I/O driver.  */
172 
173 /*#define FX_DRIVER_USE_64BIT_LBA   */
174 
175 
176 /* Defined, enables FileX fault tolerant service.  */
177 
178 /*#define FX_ENABLE_FAULT_TOLERANT   */
179 
180 
181 /* Define byte offset in boot sector where the cluster number of the Fault Tolerant Log file is.
182    Note that this field (byte 116 to 119) is marked as reserved by FAT 12/16/32 specification. */
183 
184 /*#define FX_FAULT_TOLERANT_BOOT_INDEX      116 */
185 
186 /* Below FX_DISABLE_XXX macros can be used for code size optimization required for memory
187    critical aplications */
188 
189 /* Defined, error checking is disabled.  */
190 
191 /*#define FX_DISABLE_ERROR_CHECKING   */
192 
193 
194 /* Defined, cache is disabled.  */
195 
196 /*#define FX_DISABLE_CACHE   */
197 
198 
199 /* Defined, file close is disabled.  */
200 
201 /*#define FX_DISABLE_FILE_CLOSE   */
202 
203 
204 /* Defined, fast open is disabled.  */
205 
206 /*#define FX_DISABLE_FAST_OPEN   */
207 
208 
209 /* Defined, force memory operations are disabled.  */
210 
211 /*#define FX_DISABLE_FORCE_MEMORY_OPERATION   */
212 
213 
214 /* Defined, build options is disabled.  */
215 
216 /*#define FX_DISABLE_BUILD_OPTIONS   */
217 
218 
219 /* Defined, one line function is disabled.  */
220 
221 /*#define FX_DISABLE_ONE_LINE_FUNCTION   */
222 
223 
224 /* Defined, FAT entry refresh is disabled.  */
225 
226 /*#define FX_DIABLE_FAT_ENTRY_REFRESH   */
227 
228 
229 /* Defined, consecutive detect is disabled.  */
230 
231 /*#define FX_DISABLE_CONSECUTIVE_DETECT   */
232 
233 
234 #endif
235 
236