F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FpConfig.h
Go to the documentation of this file.
1 
11 #ifndef FPCONFIG_H_
12 #define FPCONFIG_H_
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 #include <Platform/PlatformTypes.h>
18 #include <Fw/Types/BasicTypes.h>
19 
20 
21 // ----------------------------------------------------------------------
22 // Type aliases
23 // ----------------------------------------------------------------------
24 
25 
26 
27 // Define enumeration for Time base types
28 // Note: maintaining C-style
29 typedef enum {
34  0xFFFF
35 } TimeBase;
36 #define FW_CONTEXT_DONT_CARE 0xFF
37 
38 // ----------------------------------------------------------------------
39 // Configuration switches
40 // ----------------------------------------------------------------------
41 
42 // Boolean values for serialization
43 #ifndef FW_SERIALIZE_TRUE_VALUE
44 #define FW_SERIALIZE_TRUE_VALUE (0xFF)
45 #endif
46 
47 #ifndef FW_SERIALIZE_FALSE_VALUE
48 #define FW_SERIALIZE_FALSE_VALUE (0x00)
49 #endif
50 
51 // Allow objects to have names. Allocates storage for each instance
52 #ifndef FW_OBJECT_NAMES
53 #define FW_OBJECT_NAMES \
54  1
55 #endif
56 
57 // To reduce binary size, FW_OPTIONAL_NAME(<string>) can be used to substitute strings with an empty string
58 // when running with FW_OBJECT_NAMES disabled
59 #if FW_OBJECT_NAMES == 1
60 #define FW_OPTIONAL_NAME(name) name
61 #else
62 #define FW_OPTIONAL_NAME(name) ""
63 #endif
64 
65 // Add methods to query an object about its name. Can be overridden by derived classes
66 // For FW_OBJECT_TO_STRING to work, FW_OBJECT_NAMES must be enabled
67 #if FW_OBJECT_NAMES == 1
68 #ifndef FW_OBJECT_TO_STRING
69 #define FW_OBJECT_TO_STRING \
70  1
71 #endif
72 #else
73 #define FW_OBJECT_TO_STRING 0
74 #endif
75 
76 // Adds the ability for all component related objects to register
77 // centrally.
78 #ifndef FW_OBJECT_REGISTRATION
79 #define FW_OBJECT_REGISTRATION \
80  1
81 #endif
82 
83 #ifndef FW_QUEUE_REGISTRATION
84 #define FW_QUEUE_REGISTRATION 1
85 #endif
86 
87 #ifndef FW_BAREMETAL_SCHEDULER
88 #define FW_BAREMETAL_SCHEDULER \
89  0
90 #endif
91 
92 // On some systems, use of *printf family functions (snprintf, printf, etc) require a prohibitive amount of program
93 // space. Setting this to `0` indicates that the Fw/String methods should stop using these functions to conserve
94 // program size. However, this comes at the expense of discarding format parameters. i.e. the format string is returned
95 // unchanged.
96 #ifndef FW_USE_PRINTF_FAMILY_FUNCTIONS_IN_STRING_FORMATTING
97 #define FW_USE_PRINTF_FAMILY_FUNCTIONS_IN_STRING_FORMATTING 1
98 #endif
99 
100 // Port Facilities
101 
102 // This allows tracing calls through ports for debugging
103 #ifndef FW_PORT_TRACING
104 #define FW_PORT_TRACING 1
105 #endif
106 
107 // This generates code to connect to serialized ports
108 #ifndef FW_PORT_SERIALIZATION
109 #define FW_PORT_SERIALIZATION \
110  1
111 #endif
113 
114 // Component Facilities
115 
116 // Serialization
117 
118 // Add a type id when serialization is done. More storage,
119 // but better detection of errors
120 // TODO: Not working yet
121 
122 #ifndef FW_SERIALIZATION_TYPE_ID
123 #define FW_SERIALIZATION_TYPE_ID \
124  0
125 #endif
126 
127 // Number of bytes to use for serialization IDs. More
128 // bytes is more storage, but greater number of IDs
129 #if FW_SERIALIZATION_TYPE_ID
130 #ifndef FW_SERIALIZATION_TYPE_ID_BYTES
131 #define FW_SERIALIZATION_TYPE_ID_BYTES 4
132 #endif
133 #endif
134 
135 // Set assertion form. Options:
136 // 1. FW_NO_ASSERT: assertions are compiled out, side effects are kept
137 // 2. FW_FILEID_ASSERT: asserts report a file CRC and line number
138 // 3. FW_FILENAME_ASSERT: asserts report a file path (__FILE__) and line number
139 // 4. FW_RELATIVE_PATH_ASSERT: asserts report a relative path within F´ or F´ library and line number
140 //
141 // Note: users who want alternate asserts should set assert level to FW_NO_ASSERT and define FW_ASSERT in this header
142 #ifndef FW_ASSERT_LEVEL
143 #define FW_ASSERT_LEVEL FW_FILENAME_ASSERT
144 #endif
145 
146 // Adjust various configuration parameters in the architecture. Some of the above enables may disable some of the values
147 
148 // The size of the object name stored in the object base class. Larger names will be truncated.
149 #if FW_OBJECT_NAMES
150 #ifndef FW_OBJ_NAME_BUFFER_SIZE
151 #define FW_OBJ_NAME_BUFFER_SIZE \
152  80
153 #endif
154 #endif
155 
156 #if FW_OBJECT_REGISTRATION
157 // For the simple object registry provided with the framework, this specifies how many objects the registry will store.
158 #ifndef FW_OBJ_SIMPLE_REG_ENTRIES
159 #define FW_OBJ_SIMPLE_REG_ENTRIES 500
160 #endif
161 // When dumping the contents of the registry, this specifies the size of the buffer used to store object names. Should
162 // be >= FW_OBJ_NAME_BUFFER_SIZE.
163 #ifndef FW_OBJ_SIMPLE_REG_BUFF_SIZE
164 #define FW_OBJ_SIMPLE_REG_BUFF_SIZE 255
165 #endif
166 #endif
167 
168 #if FW_QUEUE_REGISTRATION
169 // For the simple queue registry provided with the framework, this specifies how many queues the registry will store.
170 #ifndef FW_QUEUE_SIMPLE_QUEUE_ENTRIES
171 #define FW_QUEUE_SIMPLE_QUEUE_ENTRIES 100
172 #endif
173 #endif
174 
175 // Specifies the size of the string holding the queue name for queues
176 #ifndef FW_QUEUE_NAME_BUFFER_SIZE
177 #define FW_QUEUE_NAME_BUFFER_SIZE 80
178 #endif
179 
180 // Specifies the size of the string holding the task name for active components and tasks
181 #ifndef FW_TASK_NAME_BUFFER_SIZE
182 #define FW_TASK_NAME_BUFFER_SIZE 80
183 #endif
184 
185 // Specifies the size of the buffer that contains a communications packet.
186 #ifndef FW_COM_BUFFER_MAX_SIZE
187 #define FW_COM_BUFFER_MAX_SIZE 512
188 #endif
189 
190 // Specifies the size of the buffer attached to state machine signals.
191 #ifndef FW_SM_SIGNAL_BUFFER_MAX_SIZE
192 #define FW_SM_SIGNAL_BUFFER_MAX_SIZE 128 // Not to exceed max value of FwSizeType
193 #endif
194 
195 // Specifies the size of the buffer that contains the serialized command arguments.
196 
197 #ifndef FW_CMD_ARG_BUFFER_MAX_SIZE
198 #define FW_CMD_ARG_BUFFER_MAX_SIZE (FW_COM_BUFFER_MAX_SIZE - sizeof(FwOpcodeType) - sizeof(FwPacketDescriptorType))
199 #endif
200 
201 // Specifies the maximum size of a string in a command argument
202 #ifndef FW_CMD_STRING_MAX_SIZE
203 #define FW_CMD_STRING_MAX_SIZE 40
204 #endif
205 
206 // Normally when a command is deserialized, the handler checks to see if there are any leftover
207 // bytes in the buffer. If there are, it assumes that the command was corrupted somehow since
208 // the serialized size should match the serialized size of the argument list. In some cases,
209 // command buffers are padded so the data can be larger than the serialized size of the command.
210 // Setting the below to zero will disable the check at the cost of not detecting commands that
211 // are too large.
212 #ifndef FW_CMD_CHECK_RESIDUAL
213 #define FW_CMD_CHECK_RESIDUAL 1
214 #endif
215 
216 // Specifies the size of the buffer that contains the serialized log arguments.
217 #ifndef FW_LOG_BUFFER_MAX_SIZE
218 #define FW_LOG_BUFFER_MAX_SIZE (FW_COM_BUFFER_MAX_SIZE - sizeof(FwEventIdType) - sizeof(FwPacketDescriptorType))
219 #endif
220 
221 // Specifies the maximum size of a string in a log event
222 // Note: This constant truncates file names in assertion failure event reports
223 #ifndef FW_LOG_STRING_MAX_SIZE
224 #define FW_LOG_STRING_MAX_SIZE 200
225 #endif
226 
227 // Specifies the size of the buffer that contains the serialized telemetry value.
228 #ifndef FW_TLM_BUFFER_MAX_SIZE
229 #define FW_TLM_BUFFER_MAX_SIZE (FW_COM_BUFFER_MAX_SIZE - sizeof(FwChanIdType) - sizeof(FwPacketDescriptorType))
230 #endif
231 
232 // Specifies the size of the buffer that contains statement args for the FpySequencer
233 #ifndef FW_STATEMENT_ARG_BUFFER_MAX_SIZE
234 #define FW_STATEMENT_ARG_BUFFER_MAX_SIZE (FW_CMD_ARG_BUFFER_MAX_SIZE)
235 #endif
236 
237 // Specifies the maximum size of a string in a telemetry channel
238 #ifndef FW_TLM_STRING_MAX_SIZE
239 #define FW_TLM_STRING_MAX_SIZE 40
240 #endif
241 
242 // Specifies the size of the buffer that contains the serialized parameter value.
243 #ifndef FW_PARAM_BUFFER_MAX_SIZE
244 #define FW_PARAM_BUFFER_MAX_SIZE (FW_COM_BUFFER_MAX_SIZE - sizeof(FwPrmIdType) - sizeof(FwPacketDescriptorType))
245 #endif
246 
247 // Specifies the maximum size of a string in a parameter
248 #ifndef FW_PARAM_STRING_MAX_SIZE
249 #define FW_PARAM_STRING_MAX_SIZE 40
250 #endif
251 
252 // Specifies the maximum size of a file upload chunk
253 #ifndef FW_FILE_BUFFER_MAX_SIZE
254 #define FW_FILE_BUFFER_MAX_SIZE 255
255 #endif
256 
257 // Specifies the maximum size of a string in an interface call
258 #ifndef FW_INTERNAL_INTERFACE_STRING_MAX_SIZE
259 #define FW_INTERNAL_INTERFACE_STRING_MAX_SIZE 256
260 #endif
261 
262 // Enables text logging of events as well as data logging. Adds a second logging port for text output.
263 // In order to set this to 0, FPRIME_ENABLE_TEXT_LOGGERS must be set to OFF.
264 #ifndef FW_ENABLE_TEXT_LOGGING
265 #define FW_ENABLE_TEXT_LOGGING 1
266 #endif
267 
268 // Define the size of the text log string buffer. Should be large enough for format string and arguments
269 #ifndef FW_LOG_TEXT_BUFFER_SIZE
270 #define FW_LOG_TEXT_BUFFER_SIZE 256
271 #endif
272 
273 // Define if serializables have toString() method. Turning off will save code space and
274 // string constants. Must be enabled if text logging enabled
275 #ifndef FW_SERIALIZABLE_TO_STRING
276 #define FW_SERIALIZABLE_TO_STRING 1
277 #endif
278 
279 // Some settings to enable AMPCS compatibility. This breaks regular ISF GUI compatibility
280 #ifndef FW_AMPCS_COMPATIBLE
281 #define FW_AMPCS_COMPATIBLE 0
282 #endif
283 
284 // These settings configure whether or not the timebase and context values for the Fw::Time
285 // class are used. Some systems may not use or need those fields
286 
287 #ifndef FW_USE_TIME_BASE
288 #define FW_USE_TIME_BASE 1
289 #endif
290 
291 #ifndef FW_USE_TIME_CONTEXT
292 #define FW_USE_TIME_CONTEXT 1
293 #endif
294 
295 // Configuration for Fw::String
296 
297 #ifndef FW_FIXED_LENGTH_STRING_SIZE
298 #define FW_FIXED_LENGTH_STRING_SIZE 256
299 #endif
300 
301 // OS configuration
302 #ifndef FW_CONSOLE_HANDLE_MAX_SIZE
303 #define FW_CONSOLE_HANDLE_MAX_SIZE 24
304 #endif
305 
306 #ifndef FW_TASK_HANDLE_MAX_SIZE
307 #define FW_TASK_HANDLE_MAX_SIZE 24
308 #endif
309 
310 #ifndef FW_FILE_HANDLE_MAX_SIZE
311 #define FW_FILE_HANDLE_MAX_SIZE 16
312 #endif
313 
314 #ifndef FW_MUTEX_HANDLE_MAX_SIZE
315 #define FW_MUTEX_HANDLE_MAX_SIZE 72
316 #endif
317 
318 #ifndef FW_QUEUE_HANDLE_MAX_SIZE
319 #define FW_QUEUE_HANDLE_MAX_SIZE 352
320 #endif
321 
322 #ifndef FW_DIRECTORY_HANDLE_MAX_SIZE
323 #define FW_DIRECTORY_HANDLE_MAX_SIZE 16
324 #endif
325 
326 #ifndef FW_FILESYSTEM_HANDLE_MAX_SIZE
327 #define FW_FILESYSTEM_HANDLE_MAX_SIZE 16
328 #endif
329 
330 #ifndef FW_RAW_TIME_HANDLE_MAX_SIZE
331 #define FW_RAW_TIME_HANDLE_MAX_SIZE 32
332 #endif
333 
334 #ifndef FW_RAW_TIME_SERIALIZATION_MAX_SIZE
335 #define FW_RAW_TIME_SERIALIZATION_MAX_SIZE 8
336 #endif
337 
338 #ifndef FW_CONDITION_VARIABLE_HANDLE_MAX_SIZE
339 #define FW_CONDITION_VARIABLE_HANDLE_MAX_SIZE 56
340 #endif
341 
342 #ifndef FW_CPU_HANDLE_MAX_SIZE
343 #define FW_CPU_HANDLE_MAX_SIZE 16
344 #endif
345 
346 #ifndef FW_MEMORY_HANDLE_MAX_SIZE
347 #define FW_MEMORY_HANDLE_MAX_SIZE 16
348 #endif
349 
350 #ifndef FW_HANDLE_ALIGNMENT
351 #define FW_HANDLE_ALIGNMENT 8
352 #endif
353 
354 // Note: One buffer of this size will be stack-allocated during certain OSAL operations e.g. when copying a file
355 #ifndef FW_FILE_CHUNK_SIZE
356 #define FW_FILE_CHUNK_SIZE 512
357 #endif
358 
359 // *** NOTE configuration checks are in Fw/Cfg/ConfigCheck.cpp in order to have
360 // the type definitions in Fw/Types/BasicTypes available.
361 #ifdef __cplusplus
362 }
363 #endif
364 
365 #endif
Indicates time is processor cycle time. Not tied to external time.
Definition: FpConfig.h:31
Don&#39;t care value for sequences. If FwTimeBaseStoreType is changed, value should be changed...
Definition: FpConfig.h:33
No time base has been established.
Definition: FpConfig.h:30
Time as reported on workstation where software is running. For testing.
Definition: FpConfig.h:32
TimeBase
Definition: FpConfig.h:29