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