Statistics
| Branch: | Tag: | Revision:

amiro-os / modules / aos_chconf.h @ b010278f

History | View | Annotate | Download (22.251 KB)

1 043cdf33 Thomas Schöpping
/*
2
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
3 84f0ce9e Thomas Schöpping
Copyright (C) 2016..2019  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 8547080b Thomas Schöpping
#define CH_CFG_ST_TIMEDELTA                 20
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 043cdf33 Thomas Schöpping
#define CH_CFG_USE_TM                       TRUE
169 732a4657 Thomas Schöpping
#endif
170 043cdf33 Thomas Schöpping
171
/**
172
 * @brief   Threads registry APIs.
173
 * @details If enabled then the registry APIs are included in the kernel.
174
 *
175
 * @note    The default is @p TRUE.
176
 */
177 732a4657 Thomas Schöpping
#if !defined(CH_CFG_USE_REGISTRY)
178 043cdf33 Thomas Schöpping
#define CH_CFG_USE_REGISTRY                 FALSE
179 732a4657 Thomas Schöpping
#endif
180 043cdf33 Thomas Schöpping
181
/**
182 0a89baf2 Thomas Schöpping
 * @brief   Thread hierarchy APIs.
183
 * @details Id enabled then the thread hierarchy APIs are included in the kernel.
184
 *
185
 * @note    The default is @p FALSE.
186
 */
187 732a4657 Thomas Schöpping
#if !defined(CH_CFG_USE_THREADHIERARCHY)
188 0a89baf2 Thomas Schöpping
#define CH_CFG_USE_THREADHIERARCHY          TRUE
189 732a4657 Thomas Schöpping
#endif
190 0a89baf2 Thomas Schöpping
191
/**
192
 * @brief   Enable ordering of child lists.
193
 * @details Children will be ordered by their priority (descending).
194
 *          If sibliblings have identical priority, they are ordered by age (descending).
195
 */
196 732a4657 Thomas Schöpping
#if !defined(CH_CFG_THREADHIERARCHY_ORDERED)
197 0a89baf2 Thomas Schöpping
#define CH_CFG_THREADHIERARCHY_ORDERED      TRUE
198 732a4657 Thomas Schöpping
#endif
199 0a89baf2 Thomas Schöpping
200
/**
201 043cdf33 Thomas Schöpping
 * @brief   Threads synchronization APIs.
202
 * @details If enabled then the @p chThdWait() function is included in
203
 *          the kernel.
204
 *
205
 * @note    The default is @p TRUE.
206
 */
207 732a4657 Thomas Schöpping
#if !defined(CH_CFG_USE_WAITEXIT)
208 043cdf33 Thomas Schöpping
#define CH_CFG_USE_WAITEXIT                 TRUE
209 732a4657 Thomas Schöpping
#endif
210 043cdf33 Thomas Schöpping
211
/**
212
 * @brief   Semaphores APIs.
213
 * @details If enabled then the Semaphores APIs are included in the kernel.
214
 *
215
 * @note    The default is @p TRUE.
216
 */
217 732a4657 Thomas Schöpping
#if !defined(CH_CFG_USE_SEMAPHORES)
218 043cdf33 Thomas Schöpping
#define CH_CFG_USE_SEMAPHORES               TRUE
219 732a4657 Thomas Schöpping
#endif
220 043cdf33 Thomas Schöpping
221
/**
222
 * @brief   Semaphores queuing mode.
223
 * @details If enabled then the threads are enqueued on semaphores by
224
 *          priority rather than in FIFO order.
225
 *
226
 * @note    The default is @p FALSE. Enable this if you have special
227
 *          requirements.
228
 * @note    Requires @p CH_CFG_USE_SEMAPHORES.
229
 */
230 732a4657 Thomas Schöpping
#if !defined(CH_CFG_USE_SEMAPHORES_PRIORITY)
231 043cdf33 Thomas Schöpping
#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE
232 732a4657 Thomas Schöpping
#endif
233 043cdf33 Thomas Schöpping
234
/**
235
 * @brief   Mutexes APIs.
236
 * @details If enabled then the mutexes APIs are included in the kernel.
237
 *
238
 * @note    The default is @p TRUE.
239
 */
240 732a4657 Thomas Schöpping
#if !defined(CH_CFG_USE_MUTEXES)
241 043cdf33 Thomas Schöpping
#define CH_CFG_USE_MUTEXES                  TRUE
242 732a4657 Thomas Schöpping
#endif
243 043cdf33 Thomas Schöpping
244
/**
245
 * @brief   Enables recursive behavior on mutexes.
246
 * @note    Recursive mutexes are heavier and have an increased
247
 *          memory footprint.
248
 *
249
 * @note    The default is @p FALSE.
250
 * @note    Requires @p CH_CFG_USE_MUTEXES.
251
 */
252 732a4657 Thomas Schöpping
#if !defined(CH_CFG_USE_MUTEXES_RECURSIVE)
253 043cdf33 Thomas Schöpping
#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE
254 732a4657 Thomas Schöpping
#endif
255 043cdf33 Thomas Schöpping
256
/**
257
 * @brief   Conditional Variables APIs.
258
 * @details If enabled then the conditional variables APIs are included
259
 *          in the kernel.
260
 *
261
 * @note    The default is @p TRUE.
262
 * @note    Requires @p CH_CFG_USE_MUTEXES.
263
 */
264 732a4657 Thomas Schöpping
#if !defined(CH_CFG_USE_CONDVARS)
265 043cdf33 Thomas Schöpping
#define CH_CFG_USE_CONDVARS                 TRUE
266 732a4657 Thomas Schöpping
#endif
267 043cdf33 Thomas Schöpping
268
/**
269
 * @brief   Conditional Variables APIs with timeout.
270
 * @details If enabled then the conditional variables APIs with timeout
271
 *          specification are included in the kernel.
272
 *
273
 * @note    The default is @p TRUE.
274
 * @note    Requires @p CH_CFG_USE_CONDVARS.
275
 */
276 732a4657 Thomas Schöpping
#if !defined(CH_CFG_USE_CONDVARS_TIMEOUT)
277 043cdf33 Thomas Schöpping
#define CH_CFG_USE_CONDVARS_TIMEOUT         TRUE
278 732a4657 Thomas Schöpping
#endif
279 043cdf33 Thomas Schöpping
280
/**
281
 * @brief   Events Flags APIs.
282
 * @details If enabled then the event flags APIs are included in the kernel.
283
 *
284
 * @note    The default is @p TRUE.
285
 */
286 732a4657 Thomas Schöpping
#if !defined(CH_CFG_USE_EVENTS)
287 043cdf33 Thomas Schöpping
#define CH_CFG_USE_EVENTS                   TRUE
288 732a4657 Thomas Schöpping
#endif
289 043cdf33 Thomas Schöpping
290
/**
291
 * @brief   Events Flags APIs with timeout.
292
 * @details If enabled then the events APIs with timeout specification
293
 *          are included in the kernel.
294
 *
295
 * @note    The default is @p TRUE.
296
 * @note    Requires @p CH_CFG_USE_EVENTS.
297
 */
298 732a4657 Thomas Schöpping
#if !defined(CH_CFG_USE_EVENTS_TIMEOUT)
299 043cdf33 Thomas Schöpping
#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE
300 732a4657 Thomas Schöpping
#endif
301 043cdf33 Thomas Schöpping
302
/**
303
 * @brief   Synchronous Messages APIs.
304
 * @details If enabled then the synchronous messages APIs are included
305
 *          in the kernel.
306
 *
307
 * @note    The default is @p TRUE.
308
 */
309 732a4657 Thomas Schöpping
#if !defined(CH_CFG_USE_MESSAGES)
310 043cdf33 Thomas Schöpping
#define CH_CFG_USE_MESSAGES                 FALSE
311 732a4657 Thomas Schöpping
#endif
312 043cdf33 Thomas Schöpping
313
/**
314
 * @brief   Synchronous Messages queuing mode.
315
 * @details If enabled then messages are served by priority rather than in
316
 *          FIFO order.
317
 *
318
 * @note    The default is @p FALSE. Enable this if you have special
319
 *          requirements.
320
 * @note    Requires @p CH_CFG_USE_MESSAGES.
321
 */
322 732a4657 Thomas Schöpping
#if !defined(CH_CFG_USE_MESSAGES_PRIORITY)
323 043cdf33 Thomas Schöpping
#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE
324 732a4657 Thomas Schöpping
#endif
325 043cdf33 Thomas Schöpping
326
/**
327
 * @brief   Mailboxes APIs.
328
 * @details If enabled then the asynchronous messages (mailboxes) APIs are
329
 *          included in the kernel.
330
 *
331
 * @note    The default is @p TRUE.
332
 * @note    Requires @p CH_CFG_USE_SEMAPHORES.
333
 */
334 732a4657 Thomas Schöpping
#if !defined(CH_CFG_USE_MAILBOXES)
335 043cdf33 Thomas Schöpping
#define CH_CFG_USE_MAILBOXES                FALSE
336 732a4657 Thomas Schöpping
#endif
337 043cdf33 Thomas Schöpping
338
/**
339
 * @brief   Core Memory Manager APIs.
340
 * @details If enabled then the core memory manager APIs are included
341
 *          in the kernel.
342
 *
343
 * @note    The default is @p TRUE.
344
 */
345 732a4657 Thomas Schöpping
#if !defined(CH_CFG_USE_MEMCORE)
346 043cdf33 Thomas Schöpping
#define CH_CFG_USE_MEMCORE                  FALSE
347 732a4657 Thomas Schöpping
#endif
348 043cdf33 Thomas Schöpping
349
/**
350
 * @brief   Heap Allocator APIs.
351
 * @details If enabled then the memory heap allocator APIs are included
352
 *          in the kernel.
353
 *
354
 * @note    The default is @p TRUE.
355
 * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
356
 *          @p CH_CFG_USE_SEMAPHORES.
357
 * @note    Mutexes are recommended.
358
 */
359 732a4657 Thomas Schöpping
#if !defined(CH_CFG_USE_HEAP)
360 043cdf33 Thomas Schöpping
#define CH_CFG_USE_HEAP                     FALSE
361 732a4657 Thomas Schöpping
#endif
362 043cdf33 Thomas Schöpping
363
/**
364
 * @brief   Memory Pools Allocator APIs.
365
 * @details If enabled then the memory pools allocator APIs are included
366
 *          in the kernel.
367
 *
368
 * @note    The default is @p TRUE.
369
 */
370 732a4657 Thomas Schöpping
#if !defined(CH_CFG_USE_MEMPOOLS)
371 043cdf33 Thomas Schöpping
#define CH_CFG_USE_MEMPOOLS                 FALSE
372 732a4657 Thomas Schöpping
#endif
373 043cdf33 Thomas Schöpping
374
/**
375 732a4657 Thomas Schöpping
 * @brief   Objects FIFOs APIs.
376 1e5f7648 Thomas Schöpping
 * @details If enabled then the objects FIFOs APIs are included
377
 *          in the kernel.
378
 *
379
 * @note    The default is @p TRUE.
380
 */
381 732a4657 Thomas Schöpping
#if !defined(CH_CFG_USE_OBJ_FIFOS)
382 1e5f7648 Thomas Schöpping
#define CH_CFG_USE_OBJ_FIFOS                FALSE
383 732a4657 Thomas Schöpping
#endif
384
385
/**
386
 * @brief   Pipes APIs.
387
 * @details If enabled then the pipes APIs are included
388
 *          in the kernel.
389
 *
390
 * @note    The default is @p TRUE.
391
 */
392
#if !defined(CH_CFG_USE_PIPES)
393
#define CH_CFG_USE_PIPES                    FALSE
394
#endif
395 1e5f7648 Thomas Schöpping
396
/**
397 043cdf33 Thomas Schöpping
 * @brief   Dynamic Threads APIs.
398
 * @details If enabled then the dynamic threads creation APIs are included
399
 *          in the kernel.
400
 *
401
 * @note    The default is @p TRUE.
402
 * @note    Requires @p CH_CFG_USE_WAITEXIT.
403
 * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
404
 */
405 732a4657 Thomas Schöpping
#if !defined(CH_CFG_USE_DYNAMIC)
406 043cdf33 Thomas Schöpping
#define CH_CFG_USE_DYNAMIC                  FALSE
407 732a4657 Thomas Schöpping
#endif
408 043cdf33 Thomas Schöpping
409
/** @} */
410
411
/*===========================================================================*/
412
/**
413 1e5f7648 Thomas Schöpping
 * @name Objects factory options
414
 * @{
415
 */
416
/*===========================================================================*/
417
418
/**
419
 * @brief   Objects Factory APIs.
420
 * @details If enabled then the objects factory APIs are included in the
421
 *          kernel.
422
 *
423
 * @note    The default is @p FALSE.
424
 */
425
#if !defined(CH_CFG_USE_FACTORY)
426
#define CH_CFG_USE_FACTORY                  FALSE
427
#endif
428
429
/**
430
 * @brief   Maximum length for object names.
431
 * @details If the specified length is zero then the name is stored by
432
 *          pointer but this could have unintended side effects.
433
 */
434
#if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH)
435
#define CH_CFG_FACTORY_MAX_NAMES_LENGTH     8
436
#endif
437
438
/**
439
 * @brief   Enables the registry of generic objects.
440
 */
441
#if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY)
442
#define CH_CFG_FACTORY_OBJECTS_REGISTRY     TRUE
443
#endif
444
445
/**
446
 * @brief   Enables factory for generic buffers.
447
 */
448
#if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS)
449
#define CH_CFG_FACTORY_GENERIC_BUFFERS      TRUE
450
#endif
451
452
/**
453
 * @brief   Enables factory for semaphores.
454
 */
455
#if !defined(CH_CFG_FACTORY_SEMAPHORES)
456
#define CH_CFG_FACTORY_SEMAPHORES           TRUE
457
#endif
458
459
/**
460
 * @brief   Enables factory for mailboxes.
461
 */
462
#if !defined(CH_CFG_FACTORY_MAILBOXES)
463
#define CH_CFG_FACTORY_MAILBOXES            TRUE
464
#endif
465
466
/**
467
 * @brief   Enables factory for objects FIFOs.
468
 */
469
#if !defined(CH_CFG_FACTORY_OBJ_FIFOS)
470
#define CH_CFG_FACTORY_OBJ_FIFOS            TRUE
471
#endif
472
473 732a4657 Thomas Schöpping
/**
474
 * @brief   Enables factory for Pipes.
475
 */
476
#if !defined(CH_CFG_FACTORY_PIPES) || defined(__DOXYGEN__)
477
#define CH_CFG_FACTORY_PIPES                TRUE
478
#endif
479
480 1e5f7648 Thomas Schöpping
/** @} */
481
482
/*===========================================================================*/
483
/**
484 043cdf33 Thomas Schöpping
 * @name Debug options
485
 * @{
486
 */
487
/*===========================================================================*/
488
489
/**
490
 * @brief   Debug option, kernel statistics.
491
 *
492
 * @note    The default is @p FALSE.
493
 */
494 732a4657 Thomas Schöpping
#if !defined(CH_DBG_STATISTICS)
495 043cdf33 Thomas Schöpping
#if ((CH_CFG_USE_TM == TRUE) && (AMIROOS_CFG_DBG == true)) || defined(__DOXYGEN__)
496
  #define CH_DBG_STATISTICS                 TRUE
497
#else
498
  #define CH_DBG_STATISTICS                 FALSE
499
#endif
500 732a4657 Thomas Schöpping
#endif
501 043cdf33 Thomas Schöpping
502
/**
503
 * @brief   Debug option, system state check.
504
 * @details If enabled the correct call protocol for system APIs is checked
505
 *          at runtime.
506
 *
507
 * @note    The default is @p FALSE.
508
 */
509 732a4657 Thomas Schöpping
#if !defined(CH_DBG_SYSTEM_STATE_CHECK)
510 043cdf33 Thomas Schöpping
#if (AMIROOS_CFG_DBG == true) || defined(__DOXYGEN__)
511
  #define CH_DBG_SYSTEM_STATE_CHECK         TRUE
512
#else
513
  #define CH_DBG_SYSTEM_STATE_CHECK         FALSE
514
#endif
515 732a4657 Thomas Schöpping
#endif
516 043cdf33 Thomas Schöpping
517
/**
518
 * @brief   Debug option, parameters checks.
519
 * @details If enabled then the checks on the API functions input
520
 *          parameters are activated.
521
 *
522
 * @note    The default is @p FALSE.
523
 */
524 732a4657 Thomas Schöpping
#if !defined(CH_DBG_ENABLE_CHECKS)
525 043cdf33 Thomas Schöpping
#if (AMIROOS_CFG_DBG == true) || defined(__DOXYGEN__)
526
  #define CH_DBG_ENABLE_CHECKS              TRUE
527
#else
528
  #define CH_DBG_ENABLE_CHECKS              FALSE
529
#endif
530 732a4657 Thomas Schöpping
#endif
531 043cdf33 Thomas Schöpping
532
/**
533
 * @brief   Debug option, consistency checks.
534
 * @details If enabled then all the assertions in the kernel code are
535
 *          activated. This includes consistency checks inside the kernel,
536
 *          runtime anomalies and port-defined checks.
537
 *
538
 * @note    The default is @p FALSE.
539
 */
540 732a4657 Thomas Schöpping
#if !defined(CH_DBG_ENABLE_ASSERTS)
541 043cdf33 Thomas Schöpping
#if (AMIROOS_CFG_DBG == true) || defined(__DOXYGEN__)
542
  #define CH_DBG_ENABLE_ASSERTS             TRUE
543
#else
544
  #define CH_DBG_ENABLE_ASSERTS             FALSE
545
#endif
546 732a4657 Thomas Schöpping
#endif
547 043cdf33 Thomas Schöpping
548
/**
549
 * @brief   Debug option, trace buffer.
550
 * @details If enabled then the trace buffer is activated.
551
 *
552
 * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.
553
 */
554 732a4657 Thomas Schöpping
#if !defined(CH_DBG_TRACE_MASK)
555 043cdf33 Thomas Schöpping
#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED
556 732a4657 Thomas Schöpping
#endif
557 043cdf33 Thomas Schöpping
558
/**
559
 * @brief   Trace buffer entries.
560
 * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
561
 *          different from @p CH_DBG_TRACE_MASK_DISABLED.
562
 */
563 732a4657 Thomas Schöpping
#if !defined(CH_DBG_TRACE_BUFFER_SIZE)
564 043cdf33 Thomas Schöpping
#define CH_DBG_TRACE_BUFFER_SIZE            128
565 732a4657 Thomas Schöpping
#endif
566 043cdf33 Thomas Schöpping
567
/**
568
 * @brief   Debug option, stack checks.
569
 * @details If enabled then a runtime stack check is performed.
570
 *
571
 * @note    The default is @p FALSE.
572
 * @note    The stack check is performed in a architecture/port dependent way.
573
 *          It may not be implemented or some ports.
574
 * @note    The default failure mode is to halt the system with the global
575
 *          @p panic_msg variable set to @p NULL.
576
 */
577 732a4657 Thomas Schöpping
#if !defined(CH_DBG_ENABLE_STACK_CHECK)
578 043cdf33 Thomas Schöpping
#if (AMIROOS_CFG_DBG == true) || defined(__DOXYGEN__)
579
  #define CH_DBG_ENABLE_STACK_CHECK         TRUE
580
#else
581
  #define CH_DBG_ENABLE_STACK_CHECK         FALSE
582
#endif
583 732a4657 Thomas Schöpping
#endif
584 043cdf33 Thomas Schöpping
585
/**
586
 * @brief   Debug option, stacks initialization.
587
 * @details If enabled then the threads working area is filled with a byte
588
 *          value when a thread is created. This can be useful for the
589
 *          runtime measurement of the used stack.
590
 *
591
 * @note    The default is @p FALSE.
592
 */
593 732a4657 Thomas Schöpping
#if !defined(CH_DBG_FILL_THREADS)
594 043cdf33 Thomas Schöpping
#if (AMIROOS_CFG_PROFILE == true) || defined(__DOXYGEN__)
595
  #define CH_DBG_FILL_THREADS               TRUE
596
#else
597
  #define CH_DBG_FILL_THREADS               FALSE
598
#endif
599 732a4657 Thomas Schöpping
#endif
600 043cdf33 Thomas Schöpping
601
/**
602
 * @brief   Debug option, threads profiling.
603
 * @details If enabled then a field is added to the @p thread_t structure that
604
 *          counts the system ticks occurred while executing the thread.
605
 *
606
 * @note    The default is @p FALSE.
607
 * @note    This debug option is not currently compatible with the
608
 *          tickless mode.
609
 */
610 732a4657 Thomas Schöpping
#if !defined(CH_DBG_THREADS_PROFILING)
611 043cdf33 Thomas Schöpping
#if ((CH_CFG_ST_TIMEDELTA == 0) && (AMIROOS_CFG_PROFILE == true)) || defined(__DOXYGEN__)
612
  #define CH_DBG_THREADS_PROFILING          TRUE
613
#else
614
  #define CH_DBG_THREADS_PROFILING          FALSE
615
#endif
616 732a4657 Thomas Schöpping
#endif
617 043cdf33 Thomas Schöpping
618
/** @} */
619
620
/*===========================================================================*/
621
/**
622
 * @name Kernel hooks
623
 * @{
624
 */
625
/*===========================================================================*/
626
627
/**
628 1e5f7648 Thomas Schöpping
 * @brief   System structure extension.
629
 * @details User fields added to the end of the @p ch_system_t structure.
630
 */
631
#define CH_CFG_SYSTEM_EXTRA_FIELDS                                          \
632
  /* Add threads custom fields here.*/
633
634
/**
635
 * @brief   System initialization hook.
636
 * @details User initialization code added to the @p chSysInit() function
637
 *          just before interrupts are enabled globally.
638
 */
639
#define CH_CFG_SYSTEM_INIT_HOOK() {                                         \
640
  /* Add threads initialization code here.*/                                \
641
}
642
643
/**
644 043cdf33 Thomas Schöpping
 * @brief   Threads descriptor structure extension.
645
 * @details User fields added to the end of the @p thread_t structure.
646
 */
647
#define CH_CFG_THREAD_EXTRA_FIELDS                                          \
648
  /* Add threads custom fields here.*/
649
650
/**
651
 * @brief   Threads initialization hook.
652 1e5f7648 Thomas Schöpping
 * @details User initialization code added to the @p _thread_init() function.
653 043cdf33 Thomas Schöpping
 *
654 1e5f7648 Thomas Schöpping
 * @note    It is invoked from within @p _thread_init() and implicitly from all
655 043cdf33 Thomas Schöpping
 *          the threads creation APIs.
656
 */
657
#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
658
  /* Add threads initialization code here.*/                                \
659
}
660
661
/**
662
 * @brief   Threads finalization hook.
663
 * @details User finalization code added to the @p chThdExit() API.
664
 */
665
#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \
666
  /* Add threads finalization code here.*/                                  \
667
}
668
669
/**
670
 * @brief   Context switch hook.
671
 * @details This hook is invoked just before switching between threads.
672
 */
673
#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \
674
  /* Context switch code here.*/                                            \
675
}
676
677
/**
678
 * @brief   ISR enter hook.
679
 */
680
#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \
681
  /* IRQ prologue code here.*/                                              \
682
}
683
684
/**
685
 * @brief   ISR exit hook.
686
 */
687
#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \
688
  /* IRQ epilogue code here.*/                                              \
689
}
690
691
/**
692
 * @brief   Idle thread enter hook.
693
 * @note    This hook is invoked within a critical zone, no OS functions
694
 *          should be invoked from here.
695
 * @note    This macro can be used to activate a power saving mode.
696
 */
697
#define CH_CFG_IDLE_ENTER_HOOK() {                                          \
698
  /* Idle-enter code here.*/                                                \
699
}
700
701
/**
702
 * @brief   Idle thread leave hook.
703
 * @note    This hook is invoked within a critical zone, no OS functions
704
 *          should be invoked from here.
705
 * @note    This macro can be used to deactivate a power saving mode.
706
 */
707
#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \
708
  /* Idle-leave code here.*/                                                \
709
}
710
711
/**
712
 * @brief   Idle Loop hook.
713
 * @details This hook is continuously invoked by the idle thread loop.
714
 */
715
#define CH_CFG_IDLE_LOOP_HOOK() {                                           \
716
  /* Idle loop code here.*/                                                 \
717
}
718
719
/**
720
 * @brief   System tick event hook.
721
 * @details This hook is invoked in the system tick handler immediately
722
 *          after processing the virtual timers queue.
723
 */
724
#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \
725
  /* System tick event code here.*/                                         \
726
}
727
728
/**
729
 * @brief   System halt hook.
730
 * @details This hook is invoked in case to a system halting error before
731
 *          the system is halted.
732
 */
733
#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \
734 efbf7cb1 Thomas Schöpping
  /* System halt code here.*/                                               \
735 043cdf33 Thomas Schöpping
}
736
737
/**
738
 * @brief   Trace hook.
739
 * @details This hook is invoked each time a new record is written in the
740
 *          trace buffer.
741
 */
742
#define CH_CFG_TRACE_HOOK(tep) {                                            \
743
  /* Trace code here.*/                                                     \
744
}
745
746
/** @} */
747
748
/*===========================================================================*/
749
/**
750 732a4657 Thomas Schöpping
 * @name Port-specific settings (override port settings defaulted in chcore.h).
751
 * @{
752 043cdf33 Thomas Schöpping
 */
753
/*===========================================================================*/
754
755
// These settings are specific to each module.
756
757 732a4657 Thomas Schöpping
/** @} */
758
759 043cdf33 Thomas Schöpping
/*===========================================================================*/
760
/**
761
 * @name other
762
 * @{
763
 */
764
/*===========================================================================*/
765
766
/**
767 1e5f7648 Thomas Schöpping
 * @brief   Flag to enable/disable floating point support in chprintf() and all deriviates.
768 043cdf33 Thomas Schöpping
 */
769
#define CHPRINTF_USE_FLOAT                  TRUE
770
771
/** @} */
772
773 6ff06bbf Thomas Schöpping
#endif  /* AOS_CHCONF_H */
774 043cdf33 Thomas Schöpping
775
/** @} */