amiro-os / modules / aos_chconf.h @ 2745c37f
History | View | Annotate | Download (23.1 KB)
1 | 043cdf33 | Thomas Schöpping | /*
|
---|---|---|---|
2 | AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
|
||
3 | 96621a83 | Thomas Schöpping | Copyright (C) 2016..2020 Thomas Schöpping et al.
|
4 | 043cdf33 | Thomas Schöpping | |
5 | This program is free software: you can redistribute it and/or modify
|
||
6 | it under the terms of the GNU General Public License as published by
|
||
7 | the Free Software Foundation, either version 3 of the License, or
|
||
8 | (at your option) any later version.
|
||
9 | |||
10 | This program is distributed in the hope that it will be useful,
|
||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
13 | GNU General Public License for more details.
|
||
14 | |||
15 | You should have received a copy of the GNU General Public License
|
||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
17 | */
|
||
18 | |||
19 | /**
|
||
20 | * @file os/modules/common/chconf.h
|
||
21 | * @brief Common ChibiOS Configuration file for the all modules.
|
||
22 | * @details Contains the application specific kernel settings.
|
||
23 | *
|
||
24 | * @addtogroup config
|
||
25 | * @details Kernel related settings and hooks.
|
||
26 | * @{
|
||
27 | */
|
||
28 | |||
29 | 6ff06bbf | Thomas Schöpping | #ifndef AOS_CHCONF_H
|
30 | #define AOS_CHCONF_H
|
||
31 | 043cdf33 | Thomas Schöpping | |
32 | #define _CHIBIOS_RT_CONF_
|
||
33 | 732a4657 | Thomas Schöpping | #define _CHIBIOS_RT_CONF_VER_6_0_
|
34 | 043cdf33 | Thomas Schöpping | |
35 | /*===========================================================================*/
|
||
36 | /**
|
||
37 | * @name System timers settings
|
||
38 | 1e5f7648 | Thomas Schöpping | * @{
|
39 | 043cdf33 | Thomas Schöpping | */
|
40 | /*===========================================================================*/
|
||
41 | |||
42 | 1e5f7648 | Thomas Schöpping | /**
|
43 | * @brief System tick frequency.
|
||
44 | * @details Frequency of the system timer that drives the system ticks. This
|
||
45 | * setting also defines the system tick time unit.
|
||
46 | */
|
||
47 | #if !defined(CH_CFG_ST_FREQUENCY)
|
||
48 | #define CH_CFG_ST_FREQUENCY 1000000UL |
||
49 | #endif
|
||
50 | |||
51 | /**
|
||
52 | * @brief Time intervals data size.
|
||
53 | * @note Allowed values are 16, 32 or 64 bits.
|
||
54 | */
|
||
55 | #if !defined(CH_CFG_INTERVALS_SIZE)
|
||
56 | #define CH_CFG_INTERVALS_SIZE 32 |
||
57 | #endif
|
||
58 | |||
59 | /**
|
||
60 | * @brief Time types data size.
|
||
61 | * @note Allowed values are 16 or 32 bits.
|
||
62 | */
|
||
63 | #if !defined(CH_CFG_TIME_TYPES_SIZE)
|
||
64 | #define CH_CFG_TIME_TYPES_SIZE 32 |
||
65 | #endif
|
||
66 | |||
67 | /**
|
||
68 | * @brief Time delta constant for the tick-less mode.
|
||
69 | * @note If this value is zero then the system uses the classic
|
||
70 | * periodic tick. This value represents the minimum number
|
||
71 | * of ticks that is safe to specify in a timeout directive.
|
||
72 | * The value one is not valid, timeouts are rounded up to
|
||
73 | * this value.
|
||
74 | */
|
||
75 | #if !defined(CH_CFG_ST_TIMEDELTA)
|
||
76 | 91bdafd4 | Thomas Schöpping | #define CH_CFG_ST_TIMEDELTA 1000 |
77 | 1e5f7648 | Thomas Schöpping | #endif
|
78 | |||
79 | /** @} */
|
||
80 | 043cdf33 | Thomas Schöpping | |
81 | /*===========================================================================*/
|
||
82 | /**
|
||
83 | * @name Kernel parameters and options
|
||
84 | * @{
|
||
85 | */
|
||
86 | /*===========================================================================*/
|
||
87 | |||
88 | /**
|
||
89 | * @brief Round robin interval.
|
||
90 | * @details This constant is the number of system ticks allowed for the
|
||
91 | * threads before preemption occurs. Setting this value to zero
|
||
92 | * disables the preemption for threads with equal priority and the
|
||
93 | * round robin becomes cooperative. Note that higher priority
|
||
94 | * threads can still preempt, the kernel is always preemptive.
|
||
95 | * @note Disabling the round robin preemption makes the kernel more compact
|
||
96 | * and generally faster.
|
||
97 | * @note The round robin preemption is not supported in tickless mode and
|
||
98 | * must be set to zero in that case.
|
||
99 | */
|
||
100 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_TIME_QUANTUM)
|
101 | 043cdf33 | Thomas Schöpping | #define CH_CFG_TIME_QUANTUM 0 |
102 | 732a4657 | Thomas Schöpping | #endif
|
103 | 043cdf33 | Thomas Schöpping | |
104 | /**
|
||
105 | * @brief Managed RAM size.
|
||
106 | * @details Size of the RAM area to be managed by the OS. If set to zero
|
||
107 | * then the whole available RAM is used. The core memory is made
|
||
108 | * available to the heap allocator and/or can be used directly through
|
||
109 | * the simplified core memory allocator.
|
||
110 | *
|
||
111 | * @note In order to let the OS manage the whole RAM the linker script must
|
||
112 | * provide the @p __heap_base__ and @p __heap_end__ symbols.
|
||
113 | * @note Requires @p CH_CFG_USE_MEMCORE.
|
||
114 | */
|
||
115 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_MEMCORE_SIZE)
|
116 | 043cdf33 | Thomas Schöpping | #define CH_CFG_MEMCORE_SIZE 0 |
117 | 732a4657 | Thomas Schöpping | #endif
|
118 | 043cdf33 | Thomas Schöpping | |
119 | /**
|
||
120 | * @brief Idle thread automatic spawn suppression.
|
||
121 | * @details When this option is activated the function @p chSysInit()
|
||
122 | * does not spawn the idle thread. The application @p main()
|
||
123 | * function becomes the idle thread and must implement an
|
||
124 | * infinite loop.
|
||
125 | */
|
||
126 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_NO_IDLE_THREAD)
|
127 | 043cdf33 | Thomas Schöpping | #define CH_CFG_NO_IDLE_THREAD FALSE
|
128 | 732a4657 | Thomas Schöpping | #endif
|
129 | 043cdf33 | Thomas Schöpping | |
130 | /** @} */
|
||
131 | |||
132 | /*===========================================================================*/
|
||
133 | /**
|
||
134 | * @name Performance options
|
||
135 | * @{
|
||
136 | */
|
||
137 | /*===========================================================================*/
|
||
138 | |||
139 | /**
|
||
140 | * @brief OS optimization.
|
||
141 | * @details If enabled then time efficient rather than space efficient code
|
||
142 | * is used when two possible implementations exist.
|
||
143 | *
|
||
144 | * @note This is not related to the compiler optimization options.
|
||
145 | * @note The default is @p TRUE.
|
||
146 | */
|
||
147 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_OPTIMIZE_SPEED)
|
148 | 043cdf33 | Thomas Schöpping | #define CH_CFG_OPTIMIZE_SPEED TRUE
|
149 | 732a4657 | Thomas Schöpping | #endif
|
150 | 043cdf33 | Thomas Schöpping | |
151 | /** @} */
|
||
152 | |||
153 | /*===========================================================================*/
|
||
154 | /**
|
||
155 | * @name Subsystem options
|
||
156 | * @{
|
||
157 | */
|
||
158 | /*===========================================================================*/
|
||
159 | |||
160 | /**
|
||
161 | * @brief Time Measurement APIs.
|
||
162 | * @details If enabled then the time measurement APIs are included in
|
||
163 | * the kernel.
|
||
164 | *
|
||
165 | * @note The default is @p TRUE.
|
||
166 | */
|
||
167 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_TM)
|
168 | e03a021e | Thomas Schöpping | #if ((AMIROOS_CFG_DBG == true) || (AMIROOS_CFG_PROFILE == true)) || defined(__DOXYGEN__) |
169 | #define CH_CFG_USE_TM TRUE
|
||
170 | #else
|
||
171 | #define CH_CFG_USE_TM FALSE
|
||
172 | #endif
|
||
173 | 732a4657 | Thomas Schöpping | #endif
|
174 | 043cdf33 | Thomas Schöpping | |
175 | /**
|
||
176 | * @brief Threads registry APIs.
|
||
177 | * @details If enabled then the registry APIs are included in the kernel.
|
||
178 | *
|
||
179 | * @note The default is @p TRUE.
|
||
180 | */
|
||
181 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_REGISTRY)
|
182 | a7e54ea4 | Thomas Schöpping | #define CH_CFG_USE_REGISTRY FALSE
|
183 | 732a4657 | Thomas Schöpping | #endif
|
184 | 043cdf33 | Thomas Schöpping | |
185 | /**
|
||
186 | 0a89baf2 | Thomas Schöpping | * @brief Thread hierarchy APIs.
|
187 | * @details Id enabled then the thread hierarchy APIs are included in the kernel.
|
||
188 | *
|
||
189 | * @note The default is @p FALSE.
|
||
190 | */
|
||
191 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_THREADHIERARCHY)
|
192 | 0a89baf2 | Thomas Schöpping | #define CH_CFG_USE_THREADHIERARCHY TRUE
|
193 | 732a4657 | Thomas Schöpping | #endif
|
194 | 0a89baf2 | Thomas Schöpping | |
195 | /**
|
||
196 | * @brief Enable ordering of child lists.
|
||
197 | * @details Children will be ordered by their priority (descending).
|
||
198 | * If sibliblings have identical priority, they are ordered by age (descending).
|
||
199 | */
|
||
200 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_THREADHIERARCHY_ORDERED)
|
201 | 0a89baf2 | Thomas Schöpping | #define CH_CFG_THREADHIERARCHY_ORDERED TRUE
|
202 | 732a4657 | Thomas Schöpping | #endif
|
203 | 0a89baf2 | Thomas Schöpping | |
204 | /**
|
||
205 | 043cdf33 | Thomas Schöpping | * @brief Threads synchronization APIs.
|
206 | * @details If enabled then the @p chThdWait() function is included in
|
||
207 | * the kernel.
|
||
208 | *
|
||
209 | * @note The default is @p TRUE.
|
||
210 | */
|
||
211 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_WAITEXIT)
|
212 | 043cdf33 | Thomas Schöpping | #define CH_CFG_USE_WAITEXIT TRUE
|
213 | 732a4657 | Thomas Schöpping | #endif
|
214 | 043cdf33 | Thomas Schöpping | |
215 | /**
|
||
216 | * @brief Semaphores APIs.
|
||
217 | * @details If enabled then the Semaphores APIs are included in the kernel.
|
||
218 | *
|
||
219 | * @note The default is @p TRUE.
|
||
220 | */
|
||
221 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_SEMAPHORES)
|
222 | 043cdf33 | Thomas Schöpping | #define CH_CFG_USE_SEMAPHORES TRUE
|
223 | 732a4657 | Thomas Schöpping | #endif
|
224 | 043cdf33 | Thomas Schöpping | |
225 | /**
|
||
226 | * @brief Semaphores queuing mode.
|
||
227 | * @details If enabled then the threads are enqueued on semaphores by
|
||
228 | * priority rather than in FIFO order.
|
||
229 | *
|
||
230 | * @note The default is @p FALSE. Enable this if you have special
|
||
231 | * requirements.
|
||
232 | * @note Requires @p CH_CFG_USE_SEMAPHORES.
|
||
233 | */
|
||
234 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_SEMAPHORES_PRIORITY)
|
235 | 043cdf33 | Thomas Schöpping | #define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
|
236 | 732a4657 | Thomas Schöpping | #endif
|
237 | 043cdf33 | Thomas Schöpping | |
238 | /**
|
||
239 | * @brief Mutexes APIs.
|
||
240 | * @details If enabled then the mutexes APIs are included in the kernel.
|
||
241 | *
|
||
242 | * @note The default is @p TRUE.
|
||
243 | */
|
||
244 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_MUTEXES)
|
245 | 043cdf33 | Thomas Schöpping | #define CH_CFG_USE_MUTEXES TRUE
|
246 | 732a4657 | Thomas Schöpping | #endif
|
247 | 043cdf33 | Thomas Schöpping | |
248 | /**
|
||
249 | * @brief Enables recursive behavior on mutexes.
|
||
250 | * @note Recursive mutexes are heavier and have an increased
|
||
251 | * memory footprint.
|
||
252 | *
|
||
253 | * @note The default is @p FALSE.
|
||
254 | * @note Requires @p CH_CFG_USE_MUTEXES.
|
||
255 | */
|
||
256 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_MUTEXES_RECURSIVE)
|
257 | 043cdf33 | Thomas Schöpping | #define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
|
258 | 732a4657 | Thomas Schöpping | #endif
|
259 | 043cdf33 | Thomas Schöpping | |
260 | /**
|
||
261 | * @brief Conditional Variables APIs.
|
||
262 | * @details If enabled then the conditional variables APIs are included
|
||
263 | * in the kernel.
|
||
264 | *
|
||
265 | * @note The default is @p TRUE.
|
||
266 | * @note Requires @p CH_CFG_USE_MUTEXES.
|
||
267 | */
|
||
268 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_CONDVARS)
|
269 | 043cdf33 | Thomas Schöpping | #define CH_CFG_USE_CONDVARS TRUE
|
270 | 732a4657 | Thomas Schöpping | #endif
|
271 | 043cdf33 | Thomas Schöpping | |
272 | /**
|
||
273 | * @brief Conditional Variables APIs with timeout.
|
||
274 | * @details If enabled then the conditional variables APIs with timeout
|
||
275 | * specification are included in the kernel.
|
||
276 | *
|
||
277 | 2745c37f | Thomas Schöpping | * @note The default is @p FALSE.
|
278 | 043cdf33 | Thomas Schöpping | * @note Requires @p CH_CFG_USE_CONDVARS.
|
279 | */
|
||
280 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_CONDVARS_TIMEOUT)
|
281 | 2745c37f | Thomas Schöpping | #define CH_CFG_USE_CONDVARS_TIMEOUT FALSE
|
282 | 732a4657 | Thomas Schöpping | #endif
|
283 | 043cdf33 | Thomas Schöpping | |
284 | /**
|
||
285 | * @brief Events Flags APIs.
|
||
286 | * @details If enabled then the event flags APIs are included in the kernel.
|
||
287 | *
|
||
288 | * @note The default is @p TRUE.
|
||
289 | */
|
||
290 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_EVENTS)
|
291 | 043cdf33 | Thomas Schöpping | #define CH_CFG_USE_EVENTS TRUE
|
292 | 732a4657 | Thomas Schöpping | #endif
|
293 | 043cdf33 | Thomas Schöpping | |
294 | /**
|
||
295 | * @brief Events Flags APIs with timeout.
|
||
296 | * @details If enabled then the events APIs with timeout specification
|
||
297 | * are included in the kernel.
|
||
298 | *
|
||
299 | * @note The default is @p TRUE.
|
||
300 | * @note Requires @p CH_CFG_USE_EVENTS.
|
||
301 | */
|
||
302 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_EVENTS_TIMEOUT)
|
303 | 043cdf33 | Thomas Schöpping | #define CH_CFG_USE_EVENTS_TIMEOUT TRUE
|
304 | 732a4657 | Thomas Schöpping | #endif
|
305 | 043cdf33 | Thomas Schöpping | |
306 | /**
|
||
307 | * @brief Synchronous Messages APIs.
|
||
308 | * @details If enabled then the synchronous messages APIs are included
|
||
309 | * in the kernel.
|
||
310 | *
|
||
311 | * @note The default is @p TRUE.
|
||
312 | */
|
||
313 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_MESSAGES)
|
314 | 043cdf33 | Thomas Schöpping | #define CH_CFG_USE_MESSAGES FALSE
|
315 | 732a4657 | Thomas Schöpping | #endif
|
316 | 043cdf33 | Thomas Schöpping | |
317 | /**
|
||
318 | * @brief Synchronous Messages queuing mode.
|
||
319 | * @details If enabled then messages are served by priority rather than in
|
||
320 | * FIFO order.
|
||
321 | *
|
||
322 | * @note The default is @p FALSE. Enable this if you have special
|
||
323 | * requirements.
|
||
324 | * @note Requires @p CH_CFG_USE_MESSAGES.
|
||
325 | */
|
||
326 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_MESSAGES_PRIORITY)
|
327 | 043cdf33 | Thomas Schöpping | #define CH_CFG_USE_MESSAGES_PRIORITY FALSE
|
328 | 732a4657 | Thomas Schöpping | #endif
|
329 | 043cdf33 | Thomas Schöpping | |
330 | /**
|
||
331 | * @brief Mailboxes APIs.
|
||
332 | * @details If enabled then the asynchronous messages (mailboxes) APIs are
|
||
333 | * included in the kernel.
|
||
334 | *
|
||
335 | * @note The default is @p TRUE.
|
||
336 | * @note Requires @p CH_CFG_USE_SEMAPHORES.
|
||
337 | */
|
||
338 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_MAILBOXES)
|
339 | 043cdf33 | Thomas Schöpping | #define CH_CFG_USE_MAILBOXES FALSE
|
340 | 732a4657 | Thomas Schöpping | #endif
|
341 | 043cdf33 | Thomas Schöpping | |
342 | /**
|
||
343 | * @brief Core Memory Manager APIs.
|
||
344 | * @details If enabled then the core memory manager APIs are included
|
||
345 | * in the kernel.
|
||
346 | *
|
||
347 | * @note The default is @p TRUE.
|
||
348 | */
|
||
349 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_MEMCORE)
|
350 | 043cdf33 | Thomas Schöpping | #define CH_CFG_USE_MEMCORE FALSE
|
351 | 732a4657 | Thomas Schöpping | #endif
|
352 | 043cdf33 | Thomas Schöpping | |
353 | /**
|
||
354 | * @brief Heap Allocator APIs.
|
||
355 | * @details If enabled then the memory heap allocator APIs are included
|
||
356 | * in the kernel.
|
||
357 | *
|
||
358 | * @note The default is @p TRUE.
|
||
359 | * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
|
||
360 | * @p CH_CFG_USE_SEMAPHORES.
|
||
361 | * @note Mutexes are recommended.
|
||
362 | */
|
||
363 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_HEAP)
|
364 | 043cdf33 | Thomas Schöpping | #define CH_CFG_USE_HEAP FALSE
|
365 | 732a4657 | Thomas Schöpping | #endif
|
366 | 043cdf33 | Thomas Schöpping | |
367 | /**
|
||
368 | * @brief Memory Pools Allocator APIs.
|
||
369 | * @details If enabled then the memory pools allocator APIs are included
|
||
370 | * in the kernel.
|
||
371 | *
|
||
372 | * @note The default is @p TRUE.
|
||
373 | */
|
||
374 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_MEMPOOLS)
|
375 | 043cdf33 | Thomas Schöpping | #define CH_CFG_USE_MEMPOOLS FALSE
|
376 | 732a4657 | Thomas Schöpping | #endif
|
377 | 043cdf33 | Thomas Schöpping | |
378 | /**
|
||
379 | 732a4657 | Thomas Schöpping | * @brief Objects FIFOs APIs.
|
380 | 1e5f7648 | Thomas Schöpping | * @details If enabled then the objects FIFOs APIs are included
|
381 | * in the kernel.
|
||
382 | *
|
||
383 | * @note The default is @p TRUE.
|
||
384 | */
|
||
385 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_OBJ_FIFOS)
|
386 | 1e5f7648 | Thomas Schöpping | #define CH_CFG_USE_OBJ_FIFOS FALSE
|
387 | 732a4657 | Thomas Schöpping | #endif
|
388 | |||
389 | /**
|
||
390 | * @brief Pipes APIs.
|
||
391 | * @details If enabled then the pipes APIs are included
|
||
392 | * in the kernel.
|
||
393 | *
|
||
394 | * @note The default is @p TRUE.
|
||
395 | */
|
||
396 | #if !defined(CH_CFG_USE_PIPES)
|
||
397 | #define CH_CFG_USE_PIPES FALSE
|
||
398 | #endif
|
||
399 | 1e5f7648 | Thomas Schöpping | |
400 | /**
|
||
401 | 043cdf33 | Thomas Schöpping | * @brief Dynamic Threads APIs.
|
402 | * @details If enabled then the dynamic threads creation APIs are included
|
||
403 | * in the kernel.
|
||
404 | *
|
||
405 | * @note The default is @p TRUE.
|
||
406 | * @note Requires @p CH_CFG_USE_WAITEXIT.
|
||
407 | * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
|
||
408 | */
|
||
409 | 732a4657 | Thomas Schöpping | #if !defined(CH_CFG_USE_DYNAMIC)
|
410 | 043cdf33 | Thomas Schöpping | #define CH_CFG_USE_DYNAMIC FALSE
|
411 | 732a4657 | Thomas Schöpping | #endif
|
412 | 043cdf33 | Thomas Schöpping | |
413 | /** @} */
|
||
414 | |||
415 | /*===========================================================================*/
|
||
416 | /**
|
||
417 | 1e5f7648 | Thomas Schöpping | * @name Objects factory options
|
418 | * @{
|
||
419 | */
|
||
420 | /*===========================================================================*/
|
||
421 | |||
422 | /**
|
||
423 | * @brief Objects Factory APIs.
|
||
424 | * @details If enabled then the objects factory APIs are included in the
|
||
425 | * kernel.
|
||
426 | *
|
||
427 | * @note The default is @p FALSE.
|
||
428 | */
|
||
429 | #if !defined(CH_CFG_USE_FACTORY)
|
||
430 | #define CH_CFG_USE_FACTORY FALSE
|
||
431 | #endif
|
||
432 | |||
433 | /**
|
||
434 | * @brief Maximum length for object names.
|
||
435 | * @details If the specified length is zero then the name is stored by
|
||
436 | * pointer but this could have unintended side effects.
|
||
437 | */
|
||
438 | #if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH)
|
||
439 | #define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8 |
||
440 | #endif
|
||
441 | |||
442 | /**
|
||
443 | * @brief Enables the registry of generic objects.
|
||
444 | */
|
||
445 | #if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY)
|
||
446 | #define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE
|
||
447 | #endif
|
||
448 | |||
449 | /**
|
||
450 | * @brief Enables factory for generic buffers.
|
||
451 | */
|
||
452 | #if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS)
|
||
453 | #define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE
|
||
454 | #endif
|
||
455 | |||
456 | /**
|
||
457 | * @brief Enables factory for semaphores.
|
||
458 | */
|
||
459 | #if !defined(CH_CFG_FACTORY_SEMAPHORES)
|
||
460 | #define CH_CFG_FACTORY_SEMAPHORES TRUE
|
||
461 | #endif
|
||
462 | |||
463 | /**
|
||
464 | * @brief Enables factory for mailboxes.
|
||
465 | */
|
||
466 | #if !defined(CH_CFG_FACTORY_MAILBOXES)
|
||
467 | #define CH_CFG_FACTORY_MAILBOXES TRUE
|
||
468 | #endif
|
||
469 | |||
470 | /**
|
||
471 | * @brief Enables factory for objects FIFOs.
|
||
472 | */
|
||
473 | #if !defined(CH_CFG_FACTORY_OBJ_FIFOS)
|
||
474 | #define CH_CFG_FACTORY_OBJ_FIFOS TRUE
|
||
475 | #endif
|
||
476 | |||
477 | 732a4657 | Thomas Schöpping | /**
|
478 | * @brief Enables factory for Pipes.
|
||
479 | */
|
||
480 | #if !defined(CH_CFG_FACTORY_PIPES) || defined(__DOXYGEN__)
|
||
481 | #define CH_CFG_FACTORY_PIPES TRUE
|
||
482 | #endif
|
||
483 | |||
484 | 1e5f7648 | Thomas Schöpping | /** @} */
|
485 | |||
486 | /*===========================================================================*/
|
||
487 | /**
|
||
488 | 043cdf33 | Thomas Schöpping | * @name Debug options
|
489 | * @{
|
||
490 | */
|
||
491 | /*===========================================================================*/
|
||
492 | |||
493 | /**
|
||
494 | * @brief Debug option, kernel statistics.
|
||
495 | *
|
||
496 | * @note The default is @p FALSE.
|
||
497 | */
|
||
498 | 732a4657 | Thomas Schöpping | #if !defined(CH_DBG_STATISTICS)
|
499 | e03a021e | Thomas Schöpping | #if ((CH_CFG_USE_TM == TRUE) && ((AMIROOS_CFG_DBG == true) || (AMIROOS_CFG_PROFILE == true))) || defined(__DOXYGEN__) |
500 | 043cdf33 | Thomas Schöpping | #define CH_DBG_STATISTICS TRUE
|
501 | #else
|
||
502 | #define CH_DBG_STATISTICS FALSE
|
||
503 | #endif
|
||
504 | 732a4657 | Thomas Schöpping | #endif
|
505 | 043cdf33 | Thomas Schöpping | |
506 | /**
|
||
507 | * @brief Debug option, system state check.
|
||
508 | * @details If enabled the correct call protocol for system APIs is checked
|
||
509 | * at runtime.
|
||
510 | *
|
||
511 | * @note The default is @p FALSE.
|
||
512 | */
|
||
513 | 732a4657 | Thomas Schöpping | #if !defined(CH_DBG_SYSTEM_STATE_CHECK)
|
514 | 043cdf33 | Thomas Schöpping | #if (AMIROOS_CFG_DBG == true) || defined(__DOXYGEN__) |
515 | #define CH_DBG_SYSTEM_STATE_CHECK TRUE
|
||
516 | #else
|
||
517 | #define CH_DBG_SYSTEM_STATE_CHECK FALSE
|
||
518 | #endif
|
||
519 | 732a4657 | Thomas Schöpping | #endif
|
520 | 043cdf33 | Thomas Schöpping | |
521 | /**
|
||
522 | * @brief Debug option, parameters checks.
|
||
523 | * @details If enabled then the checks on the API functions input
|
||
524 | * parameters are activated.
|
||
525 | *
|
||
526 | * @note The default is @p FALSE.
|
||
527 | */
|
||
528 | 732a4657 | Thomas Schöpping | #if !defined(CH_DBG_ENABLE_CHECKS)
|
529 | 043cdf33 | Thomas Schöpping | #if (AMIROOS_CFG_DBG == true) || defined(__DOXYGEN__) |
530 | #define CH_DBG_ENABLE_CHECKS TRUE
|
||
531 | #else
|
||
532 | #define CH_DBG_ENABLE_CHECKS FALSE
|
||
533 | #endif
|
||
534 | 732a4657 | Thomas Schöpping | #endif
|
535 | 043cdf33 | Thomas Schöpping | |
536 | /**
|
||
537 | * @brief Debug option, consistency checks.
|
||
538 | * @details If enabled then all the assertions in the kernel code are
|
||
539 | * activated. This includes consistency checks inside the kernel,
|
||
540 | * runtime anomalies and port-defined checks.
|
||
541 | *
|
||
542 | * @note The default is @p FALSE.
|
||
543 | */
|
||
544 | 732a4657 | Thomas Schöpping | #if !defined(CH_DBG_ENABLE_ASSERTS)
|
545 | 043cdf33 | Thomas Schöpping | #if (AMIROOS_CFG_DBG == true) || defined(__DOXYGEN__) |
546 | #define CH_DBG_ENABLE_ASSERTS TRUE
|
||
547 | #else
|
||
548 | #define CH_DBG_ENABLE_ASSERTS FALSE
|
||
549 | #endif
|
||
550 | 732a4657 | Thomas Schöpping | #endif
|
551 | 043cdf33 | Thomas Schöpping | |
552 | /**
|
||
553 | * @brief Debug option, trace buffer.
|
||
554 | * @details If enabled then the trace buffer is activated.
|
||
555 | *
|
||
556 | * @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
|
||
557 | */
|
||
558 | 732a4657 | Thomas Schöpping | #if !defined(CH_DBG_TRACE_MASK)
|
559 | 043cdf33 | Thomas Schöpping | #define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
|
560 | 732a4657 | Thomas Schöpping | #endif
|
561 | 043cdf33 | Thomas Schöpping | |
562 | /**
|
||
563 | * @brief Trace buffer entries.
|
||
564 | * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
|
||
565 | * different from @p CH_DBG_TRACE_MASK_DISABLED.
|
||
566 | */
|
||
567 | 732a4657 | Thomas Schöpping | #if !defined(CH_DBG_TRACE_BUFFER_SIZE)
|
568 | 043cdf33 | Thomas Schöpping | #define CH_DBG_TRACE_BUFFER_SIZE 128 |
569 | 732a4657 | Thomas Schöpping | #endif
|
570 | 043cdf33 | Thomas Schöpping | |
571 | /**
|
||
572 | * @brief Debug option, stack checks.
|
||
573 | * @details If enabled then a runtime stack check is performed.
|
||
574 | *
|
||
575 | * @note The default is @p FALSE.
|
||
576 | * @note The stack check is performed in a architecture/port dependent way.
|
||
577 | * It may not be implemented or some ports.
|
||
578 | * @note The default failure mode is to halt the system with the global
|
||
579 | * @p panic_msg variable set to @p NULL.
|
||
580 | */
|
||
581 | 732a4657 | Thomas Schöpping | #if !defined(CH_DBG_ENABLE_STACK_CHECK)
|
582 | 043cdf33 | Thomas Schöpping | #if (AMIROOS_CFG_DBG == true) || defined(__DOXYGEN__) |
583 | #define CH_DBG_ENABLE_STACK_CHECK TRUE
|
||
584 | #else
|
||
585 | #define CH_DBG_ENABLE_STACK_CHECK FALSE
|
||
586 | #endif
|
||
587 | 732a4657 | Thomas Schöpping | #endif
|
588 | 043cdf33 | Thomas Schöpping | |
589 | /**
|
||
590 | * @brief Debug option, stacks initialization.
|
||
591 | * @details If enabled then the threads working area is filled with a byte
|
||
592 | * value when a thread is created. This can be useful for the
|
||
593 | * runtime measurement of the used stack.
|
||
594 | *
|
||
595 | * @note The default is @p FALSE.
|
||
596 | */
|
||
597 | 732a4657 | Thomas Schöpping | #if !defined(CH_DBG_FILL_THREADS)
|
598 | 043cdf33 | Thomas Schöpping | #if (AMIROOS_CFG_PROFILE == true) || defined(__DOXYGEN__) |
599 | #define CH_DBG_FILL_THREADS TRUE
|
||
600 | #else
|
||
601 | #define CH_DBG_FILL_THREADS FALSE
|
||
602 | #endif
|
||
603 | 732a4657 | Thomas Schöpping | #endif
|
604 | 043cdf33 | Thomas Schöpping | |
605 | /**
|
||
606 | * @brief Debug option, threads profiling.
|
||
607 | * @details If enabled then a field is added to the @p thread_t structure that
|
||
608 | * counts the system ticks occurred while executing the thread.
|
||
609 | *
|
||
610 | * @note The default is @p FALSE.
|
||
611 | * @note This debug option is not currently compatible with the
|
||
612 | * tickless mode.
|
||
613 | */
|
||
614 | 732a4657 | Thomas Schöpping | #if !defined(CH_DBG_THREADS_PROFILING)
|
615 | 043cdf33 | Thomas Schöpping | #if ((CH_CFG_ST_TIMEDELTA == 0) && (AMIROOS_CFG_PROFILE == true)) || defined(__DOXYGEN__) |
616 | #define CH_DBG_THREADS_PROFILING TRUE
|
||
617 | #else
|
||
618 | #define CH_DBG_THREADS_PROFILING FALSE
|
||
619 | #endif
|
||
620 | 732a4657 | Thomas Schöpping | #endif
|
621 | 043cdf33 | Thomas Schöpping | |
622 | /** @} */
|
||
623 | |||
624 | /*===========================================================================*/
|
||
625 | /**
|
||
626 | * @name Kernel hooks
|
||
627 | * @{
|
||
628 | */
|
||
629 | /*===========================================================================*/
|
||
630 | |||
631 | /**
|
||
632 | 1e5f7648 | Thomas Schöpping | * @brief System structure extension.
|
633 | * @details User fields added to the end of the @p ch_system_t structure.
|
||
634 | */
|
||
635 | cda14729 | Thomas Schöpping | #if !defined(CH_CFG_SYSTEM_EXTRA_FIELDS)
|
636 | 1e5f7648 | Thomas Schöpping | #define CH_CFG_SYSTEM_EXTRA_FIELDS \
|
637 | /* Add threads custom fields here.*/
|
||
638 | cda14729 | Thomas Schöpping | #endif
|
639 | 1e5f7648 | Thomas Schöpping | |
640 | /**
|
||
641 | * @brief System initialization hook.
|
||
642 | * @details User initialization code added to the @p chSysInit() function
|
||
643 | * just before interrupts are enabled globally.
|
||
644 | */
|
||
645 | cda14729 | Thomas Schöpping | #if !defined(CH_CFG_SYSTEM_INIT_HOOK)
|
646 | 1e5f7648 | Thomas Schöpping | #define CH_CFG_SYSTEM_INIT_HOOK() { \
|
647 | /* Add threads initialization code here.*/ \
|
||
648 | } |
||
649 | cda14729 | Thomas Schöpping | #endif
|
650 | 1e5f7648 | Thomas Schöpping | |
651 | /**
|
||
652 | 043cdf33 | Thomas Schöpping | * @brief Threads descriptor structure extension.
|
653 | * @details User fields added to the end of the @p thread_t structure.
|
||
654 | */
|
||
655 | cda14729 | Thomas Schöpping | #if !defined(CH_CFG_THREAD_EXTRA_FIELDS)
|
656 | 043cdf33 | Thomas Schöpping | #define CH_CFG_THREAD_EXTRA_FIELDS \
|
657 | /* Add threads custom fields here.*/
|
||
658 | cda14729 | Thomas Schöpping | #endif
|
659 | 043cdf33 | Thomas Schöpping | |
660 | /**
|
||
661 | * @brief Threads initialization hook.
|
||
662 | 1e5f7648 | Thomas Schöpping | * @details User initialization code added to the @p _thread_init() function.
|
663 | 043cdf33 | Thomas Schöpping | *
|
664 | 1e5f7648 | Thomas Schöpping | * @note It is invoked from within @p _thread_init() and implicitly from all
|
665 | 043cdf33 | Thomas Schöpping | * the threads creation APIs.
|
666 | */
|
||
667 | cda14729 | Thomas Schöpping | #if !defined(CH_CFG_THREAD_INIT_HOOK)
|
668 | 043cdf33 | Thomas Schöpping | #define CH_CFG_THREAD_INIT_HOOK(tp) { \
|
669 | /* Add threads initialization code here.*/ \
|
||
670 | } |
||
671 | cda14729 | Thomas Schöpping | #endif
|
672 | 043cdf33 | Thomas Schöpping | |
673 | /**
|
||
674 | * @brief Threads finalization hook.
|
||
675 | * @details User finalization code added to the @p chThdExit() API.
|
||
676 | */
|
||
677 | cda14729 | Thomas Schöpping | #if !defined(CH_CFG_THREAD_EXIT_HOOK)
|
678 | 043cdf33 | Thomas Schöpping | #define CH_CFG_THREAD_EXIT_HOOK(tp) { \
|
679 | /* Add threads finalization code here.*/ \
|
||
680 | } |
||
681 | cda14729 | Thomas Schöpping | #endif
|
682 | 043cdf33 | Thomas Schöpping | |
683 | /**
|
||
684 | * @brief Context switch hook.
|
||
685 | * @details This hook is invoked just before switching between threads.
|
||
686 | */
|
||
687 | cda14729 | Thomas Schöpping | #if !defined(CH_CFG_CONTEXT_SWITCH_HOOK)
|
688 | 043cdf33 | Thomas Schöpping | #define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
|
689 | /* Context switch code here.*/ \
|
||
690 | } |
||
691 | cda14729 | Thomas Schöpping | #endif
|
692 | 043cdf33 | Thomas Schöpping | |
693 | /**
|
||
694 | * @brief ISR enter hook.
|
||
695 | */
|
||
696 | cda14729 | Thomas Schöpping | #if !defined(CH_CFG_IRQ_PROLOGUE_HOOK)
|
697 | 043cdf33 | Thomas Schöpping | #define CH_CFG_IRQ_PROLOGUE_HOOK() { \
|
698 | /* IRQ prologue code here.*/ \
|
||
699 | } |
||
700 | cda14729 | Thomas Schöpping | #endif
|
701 | 043cdf33 | Thomas Schöpping | |
702 | /**
|
||
703 | * @brief ISR exit hook.
|
||
704 | */
|
||
705 | cda14729 | Thomas Schöpping | #if !defined(CH_CFG_IRQ_EPILOGUE_HOOK)
|
706 | 043cdf33 | Thomas Schöpping | #define CH_CFG_IRQ_EPILOGUE_HOOK() { \
|
707 | /* IRQ epilogue code here.*/ \
|
||
708 | } |
||
709 | cda14729 | Thomas Schöpping | #endif
|
710 | 043cdf33 | Thomas Schöpping | |
711 | /**
|
||
712 | * @brief Idle thread enter hook.
|
||
713 | * @note This hook is invoked within a critical zone, no OS functions
|
||
714 | * should be invoked from here.
|
||
715 | * @note This macro can be used to activate a power saving mode.
|
||
716 | */
|
||
717 | cda14729 | Thomas Schöpping | #if !defined(CH_CFG_IDLE_ENTER_HOOK)
|
718 | 043cdf33 | Thomas Schöpping | #define CH_CFG_IDLE_ENTER_HOOK() { \
|
719 | /* Idle-enter code here.*/ \
|
||
720 | } |
||
721 | cda14729 | Thomas Schöpping | #endif
|
722 | 043cdf33 | Thomas Schöpping | |
723 | /**
|
||
724 | * @brief Idle thread leave hook.
|
||
725 | * @note This hook is invoked within a critical zone, no OS functions
|
||
726 | * should be invoked from here.
|
||
727 | * @note This macro can be used to deactivate a power saving mode.
|
||
728 | */
|
||
729 | cda14729 | Thomas Schöpping | #if !defined(CH_CFG_IDLE_LEAVE_HOOK)
|
730 | 043cdf33 | Thomas Schöpping | #define CH_CFG_IDLE_LEAVE_HOOK() { \
|
731 | /* Idle-leave code here.*/ \
|
||
732 | } |
||
733 | cda14729 | Thomas Schöpping | #endif
|
734 | 043cdf33 | Thomas Schöpping | |
735 | /**
|
||
736 | * @brief Idle Loop hook.
|
||
737 | * @details This hook is continuously invoked by the idle thread loop.
|
||
738 | */
|
||
739 | cda14729 | Thomas Schöpping | #if !defined(CH_CFG_IDLE_LOOP_HOOK)
|
740 | 043cdf33 | Thomas Schöpping | #define CH_CFG_IDLE_LOOP_HOOK() { \
|
741 | /* Idle loop code here.*/ \
|
||
742 | } |
||
743 | cda14729 | Thomas Schöpping | #endif
|
744 | 043cdf33 | Thomas Schöpping | |
745 | /**
|
||
746 | * @brief System tick event hook.
|
||
747 | * @details This hook is invoked in the system tick handler immediately
|
||
748 | * after processing the virtual timers queue.
|
||
749 | */
|
||
750 | cda14729 | Thomas Schöpping | #if !defined(CH_CFG_SYSTEM_TICK_HOOK)
|
751 | 043cdf33 | Thomas Schöpping | #define CH_CFG_SYSTEM_TICK_HOOK() { \
|
752 | /* System tick event code here.*/ \
|
||
753 | } |
||
754 | cda14729 | Thomas Schöpping | #endif
|
755 | 043cdf33 | Thomas Schöpping | |
756 | /**
|
||
757 | * @brief System halt hook.
|
||
758 | * @details This hook is invoked in case to a system halting error before
|
||
759 | * the system is halted.
|
||
760 | */
|
||
761 | cda14729 | Thomas Schöpping | #if !defined(CH_CFG_SYSTEM_HALT_HOOK)
|
762 | 043cdf33 | Thomas Schöpping | #define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
|
763 | efbf7cb1 | Thomas Schöpping | /* System halt code here.*/ \
|
764 | 043cdf33 | Thomas Schöpping | } |
765 | cda14729 | Thomas Schöpping | #endif
|
766 | 043cdf33 | Thomas Schöpping | |
767 | /**
|
||
768 | * @brief Trace hook.
|
||
769 | * @details This hook is invoked each time a new record is written in the
|
||
770 | * trace buffer.
|
||
771 | */
|
||
772 | cda14729 | Thomas Schöpping | #if !defined(CH_CFG_TRACE_HOOK)
|
773 | 043cdf33 | Thomas Schöpping | #define CH_CFG_TRACE_HOOK(tep) { \
|
774 | /* Trace code here.*/ \
|
||
775 | } |
||
776 | cda14729 | Thomas Schöpping | #endif
|
777 | 043cdf33 | Thomas Schöpping | |
778 | /** @} */
|
||
779 | |||
780 | /*===========================================================================*/
|
||
781 | /**
|
||
782 | 732a4657 | Thomas Schöpping | * @name Port-specific settings (override port settings defaulted in chcore.h).
|
783 | * @{
|
||
784 | 043cdf33 | Thomas Schöpping | */
|
785 | /*===========================================================================*/
|
||
786 | |||
787 | // These settings are specific to each module.
|
||
788 | |||
789 | 732a4657 | Thomas Schöpping | /** @} */
|
790 | |||
791 | 043cdf33 | Thomas Schöpping | /*===========================================================================*/
|
792 | /**
|
||
793 | * @name other
|
||
794 | * @{
|
||
795 | */
|
||
796 | /*===========================================================================*/
|
||
797 | |||
798 | /**
|
||
799 | 1e5f7648 | Thomas Schöpping | * @brief Flag to enable/disable floating point support in chprintf() and all deriviates.
|
800 | 043cdf33 | Thomas Schöpping | */
|
801 | #define CHPRINTF_USE_FLOAT TRUE
|
||
802 | |||
803 | /** @} */
|
||
804 | |||
805 | 6ff06bbf | Thomas Schöpping | #endif /* AOS_CHCONF_H */ |
806 | 043cdf33 | Thomas Schöpping | |
807 | /** @} */ |