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