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 <Fw/Types/BasicTypes.h>
18 #include <Platform/PlatformTypes.h>
19 
20 // ----------------------------------------------------------------------
21 // Configuration switches
22 // ----------------------------------------------------------------------
23 
24 // Allow objects to have names. Allocates storage for each instance
25 #ifndef FW_OBJECT_NAMES
26 #define FW_OBJECT_NAMES \
27  1
28 #endif
29 
30 // To reduce binary size, FW_OPTIONAL_NAME(<string>) can be used to substitute strings with an empty string
31 // when running with FW_OBJECT_NAMES disabled
32 #if FW_OBJECT_NAMES == 1
33 #define FW_OPTIONAL_NAME(name) name
34 #else
35 #define FW_OPTIONAL_NAME(name) ""
36 #endif
37 
38 // Add methods to query an object about its name. Can be overridden by derived classes
39 // For FW_OBJECT_TO_STRING to work, FW_OBJECT_NAMES must be enabled
40 #if FW_OBJECT_NAMES == 1
41 #ifndef FW_OBJECT_TO_STRING
42 #define FW_OBJECT_TO_STRING \
43  1
44 #endif
45 #else
46 #define FW_OBJECT_TO_STRING 0
47 #endif
48 
49 // Adds the ability for all component related objects to register
50 // centrally.
51 #ifndef FW_OBJECT_REGISTRATION
52 #define FW_OBJECT_REGISTRATION \
53  1
54 #endif
55 
56 #ifndef FW_QUEUE_REGISTRATION
57 #define FW_QUEUE_REGISTRATION 1
58 #endif
59 
60 // On some systems, use of *printf family functions (snprintf, printf, etc) require a prohibitive amount of program
61 // space. Setting this to `0` indicates that the Fw/String methods should stop using these functions to conserve
62 // program size. However, this comes at the expense of discarding format parameters. i.e. the format string is returned
63 // unchanged.
64 #ifndef FW_USE_PRINTF_FAMILY_FUNCTIONS_IN_STRING_FORMATTING
65 #define FW_USE_PRINTF_FAMILY_FUNCTIONS_IN_STRING_FORMATTING 1
66 #endif
67 
68 // Port Facilities
69 
70 // This allows tracing calls through ports for debugging
71 #ifndef FW_PORT_TRACING
72 #define FW_PORT_TRACING 1
73 #endif
74 
75 // This generates code to connect to serialized ports
76 #ifndef FW_PORT_SERIALIZATION
77 #define FW_PORT_SERIALIZATION \
78  1
79 #endif
81 
82 // Component Facilities
83 
84 // Serialization
85 
86 // Add a type id when serialization is done. More storage,
87 // but better detection of errors
88 // TODO: Not working yet
89 
90 #ifndef FW_SERIALIZATION_TYPE_ID
91 #define FW_SERIALIZATION_TYPE_ID \
92  0
93 #endif
94 
95 // Number of bytes to use for serialization IDs. More
96 // bytes is more storage, but greater number of IDs
97 #if FW_SERIALIZATION_TYPE_ID
98 #ifndef FW_SERIALIZATION_TYPE_ID_BYTES
99 #define FW_SERIALIZATION_TYPE_ID_BYTES 4
100 #endif
101 #endif
102 
103 // Set assertion form. Options:
104 // 1. FW_NO_ASSERT: assertions are compiled out, side effects are kept
105 // 2. FW_FILEID_ASSERT: asserts report a file CRC and line number
106 // 3. FW_FILENAME_ASSERT: asserts report a file path (__FILE__) and line number
107 // 4. FW_RELATIVE_PATH_ASSERT: asserts report a relative path within F' or F' library and line number
108 //
109 // Note: users who want alternate asserts should set assert level to FW_NO_ASSERT and define FW_ASSERT in this header
110 #ifndef FW_ASSERT_LEVEL
111 #define FW_ASSERT_LEVEL FW_FILENAME_ASSERT
112 #endif
113 
114 // Adjust various configuration parameters in the architecture. Some of the above enables may disable some of the values
115 
116 // The size of the object name stored in the object base class. Larger names will be truncated.
117 #if FW_OBJECT_NAMES
118 #ifndef FW_OBJ_NAME_BUFFER_SIZE
119 #define FW_OBJ_NAME_BUFFER_SIZE \
120  80
121 #endif
122 #endif
123 
124 // Normally when a command is deserialized, the handler checks to see if there are any leftover
125 // bytes in the buffer. If there are, it assumes that the command was corrupted somehow since
126 // the serialized size should match the serialized size of the argument list. In some cases,
127 // command buffers are padded so the data can be larger than the serialized size of the command.
128 // Setting the below to zero will disable the check at the cost of not detecting commands that
129 // are too large.
130 #ifndef FW_CMD_CHECK_RESIDUAL
131 #define FW_CMD_CHECK_RESIDUAL 1
132 #endif
133 
134 // Enables text logging of events as well as data logging. Adds a second logging port for text output.
135 // In order to set this to 0, FPRIME_ENABLE_TEXT_LOGGERS must be set to OFF.
136 #ifndef FW_ENABLE_TEXT_LOGGING
137 #define FW_ENABLE_TEXT_LOGGING 1
138 #endif
139 
140 // Define if serializables have toString() method. Turning off will save code space and
141 // string constants. Must be enabled if text logging enabled
142 #ifndef FW_SERIALIZABLE_TO_STRING
143 #define FW_SERIALIZABLE_TO_STRING 1
144 #endif
145 
146 // Some settings to enable AMPCS compatibility. This breaks regular ISF GUI compatibility
147 #ifndef FW_AMPCS_COMPATIBLE
148 #define FW_AMPCS_COMPATIBLE 0
149 #endif
150 
151 // *** NOTE configuration checks are in Fw/Cfg/ConfigCheck.cpp in order to have
152 // the type definitions in Fw/Types/BasicTypes available.
153 #ifdef __cplusplus
154 }
155 #endif
156 
157 #endif