Statistics
| Branch: | Tag: | Revision:

amiro-os / modules / aos_chconf.h @ 3da12676

History | View | Annotate | Download (22.9 KB)

1
/*
2
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
3
Copyright (C) 2016..2020  Thomas Schöpping et al.
4

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
#ifndef AOS_CHCONF_H
30
#define AOS_CHCONF_H
31

    
32
#define _CHIBIOS_RT_CONF_
33
#define _CHIBIOS_RT_CONF_VER_6_0_
34

    
35
/*===========================================================================*/
36
/**
37
 * @name System timers settings
38
 * @{
39
 */
40
/*===========================================================================*/
41

    
42
/**
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
#define CH_CFG_ST_TIMEDELTA                 1000
77
#endif
78

    
79
/** @} */
80

    
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
#if !defined(CH_CFG_TIME_QUANTUM)
101
#define CH_CFG_TIME_QUANTUM                 0
102
#endif
103

    
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
#if !defined(CH_CFG_MEMCORE_SIZE)
116
#define CH_CFG_MEMCORE_SIZE                 0
117
#endif
118

    
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
#if !defined(CH_CFG_NO_IDLE_THREAD)
127
#define CH_CFG_NO_IDLE_THREAD               FALSE
128
#endif
129

    
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
#if !defined(CH_CFG_OPTIMIZE_SPEED)
148
#define CH_CFG_OPTIMIZE_SPEED               TRUE
149
#endif
150

    
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
#if !defined(CH_CFG_USE_TM)
168
#define CH_CFG_USE_TM                       TRUE
169
#endif
170

    
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
#if !defined(CH_CFG_USE_REGISTRY)
178
#define CH_CFG_USE_REGISTRY                 TRUE
179
#endif
180

    
181
/**
182
 * @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
#if !defined(CH_CFG_USE_THREADHIERARCHY)
188
#define CH_CFG_USE_THREADHIERARCHY          TRUE
189
#endif
190

    
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
#if !defined(CH_CFG_THREADHIERARCHY_ORDERED)
197
#define CH_CFG_THREADHIERARCHY_ORDERED      TRUE
198
#endif
199

    
200
/**
201
 * @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
#if !defined(CH_CFG_USE_WAITEXIT)
208
#define CH_CFG_USE_WAITEXIT                 TRUE
209
#endif
210

    
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
#if !defined(CH_CFG_USE_SEMAPHORES)
218
#define CH_CFG_USE_SEMAPHORES               TRUE
219
#endif
220

    
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
#if !defined(CH_CFG_USE_SEMAPHORES_PRIORITY)
231
#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE
232
#endif
233

    
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
#if !defined(CH_CFG_USE_MUTEXES)
241
#define CH_CFG_USE_MUTEXES                  TRUE
242
#endif
243

    
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
#if !defined(CH_CFG_USE_MUTEXES_RECURSIVE)
253
#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE
254
#endif
255

    
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
#if !defined(CH_CFG_USE_CONDVARS)
265
#define CH_CFG_USE_CONDVARS                 TRUE
266
#endif
267

    
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
#if !defined(CH_CFG_USE_CONDVARS_TIMEOUT)
277
#define CH_CFG_USE_CONDVARS_TIMEOUT         TRUE
278
#endif
279

    
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
#if !defined(CH_CFG_USE_EVENTS)
287
#define CH_CFG_USE_EVENTS                   TRUE
288
#endif
289

    
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
#if !defined(CH_CFG_USE_EVENTS_TIMEOUT)
299
#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE
300
#endif
301

    
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
#if !defined(CH_CFG_USE_MESSAGES)
310
#define CH_CFG_USE_MESSAGES                 FALSE
311
#endif
312

    
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
#if !defined(CH_CFG_USE_MESSAGES_PRIORITY)
323
#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE
324
#endif
325

    
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
#if !defined(CH_CFG_USE_MAILBOXES)
335
#define CH_CFG_USE_MAILBOXES                FALSE
336
#endif
337

    
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
#if !defined(CH_CFG_USE_MEMCORE)
346
#define CH_CFG_USE_MEMCORE                  FALSE
347
#endif
348

    
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
#if !defined(CH_CFG_USE_HEAP)
360
#define CH_CFG_USE_HEAP                     FALSE
361
#endif
362

    
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
#if !defined(CH_CFG_USE_MEMPOOLS)
371
#define CH_CFG_USE_MEMPOOLS                 FALSE
372
#endif
373

    
374
/**
375
 * @brief   Objects FIFOs APIs.
376
 * @details If enabled then the objects FIFOs APIs are included
377
 *          in the kernel.
378
 *
379
 * @note    The default is @p TRUE.
380
 */
381
#if !defined(CH_CFG_USE_OBJ_FIFOS)
382
#define CH_CFG_USE_OBJ_FIFOS                FALSE
383
#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

    
396
/**
397
 * @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
#if !defined(CH_CFG_USE_DYNAMIC)
406
#define CH_CFG_USE_DYNAMIC                  FALSE
407
#endif
408

    
409
/** @} */
410

    
411
/*===========================================================================*/
412
/**
413
 * @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
/**
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
/** @} */
481

    
482
/*===========================================================================*/
483
/**
484
 * @name Debug options
485
 * @{
486
 */
487
/*===========================================================================*/
488

    
489
/**
490
 * @brief   Debug option, kernel statistics.
491
 *
492
 * @note    The default is @p FALSE.
493
 */
494
#if !defined(CH_DBG_STATISTICS)
495
#if ((CH_CFG_USE_TM == TRUE) && ((AMIROOS_CFG_DBG == true) || AMIROOS_CFG_PROFILE == true)) || defined(__DOXYGEN__)
496
  #define CH_DBG_STATISTICS                 TRUE
497
#else
498
  #define CH_DBG_STATISTICS                 FALSE
499
#endif
500
#endif
501

    
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
#if !defined(CH_DBG_SYSTEM_STATE_CHECK)
510
#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
#endif
516

    
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
#if !defined(CH_DBG_ENABLE_CHECKS)
525
#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
#endif
531

    
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
#if !defined(CH_DBG_ENABLE_ASSERTS)
541
#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
#endif
547

    
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
#if !defined(CH_DBG_TRACE_MASK)
555
#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED
556
#endif
557

    
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
#if !defined(CH_DBG_TRACE_BUFFER_SIZE)
564
#define CH_DBG_TRACE_BUFFER_SIZE            128
565
#endif
566

    
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
#if !defined(CH_DBG_ENABLE_STACK_CHECK)
578
#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
#endif
584

    
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
#if !defined(CH_DBG_FILL_THREADS)
594
#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
#endif
600

    
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
#if !defined(CH_DBG_THREADS_PROFILING)
611
#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
#endif
617

    
618
/** @} */
619

    
620
/*===========================================================================*/
621
/**
622
 * @name Kernel hooks
623
 * @{
624
 */
625
/*===========================================================================*/
626

    
627
/**
628
 * @brief   System structure extension.
629
 * @details User fields added to the end of the @p ch_system_t structure.
630
 */
631
#if !defined(CH_CFG_SYSTEM_EXTRA_FIELDS)
632
#define CH_CFG_SYSTEM_EXTRA_FIELDS                                          \
633
  /* Add threads custom fields here.*/
634
#endif
635

    
636
/**
637
 * @brief   System initialization hook.
638
 * @details User initialization code added to the @p chSysInit() function
639
 *          just before interrupts are enabled globally.
640
 */
641
#if !defined(CH_CFG_SYSTEM_INIT_HOOK)
642
#define CH_CFG_SYSTEM_INIT_HOOK() {                                         \
643
  /* Add threads initialization code here.*/                                \
644
}
645
#endif
646

    
647
/**
648
 * @brief   Threads descriptor structure extension.
649
 * @details User fields added to the end of the @p thread_t structure.
650
 */
651
#if !defined(CH_CFG_THREAD_EXTRA_FIELDS)
652
#define CH_CFG_THREAD_EXTRA_FIELDS                                          \
653
  /* Add threads custom fields here.*/
654
#endif
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
#if !defined(CH_CFG_THREAD_INIT_HOOK)
664
#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
665
  /* Add threads initialization code here.*/                                \
666
}
667
#endif
668

    
669
/**
670
 * @brief   Threads finalization hook.
671
 * @details User finalization code added to the @p chThdExit() API.
672
 */
673
#if !defined(CH_CFG_THREAD_EXIT_HOOK)
674
#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \
675
  /* Add threads finalization code here.*/                                  \
676
}
677
#endif
678

    
679
/**
680
 * @brief   Context switch hook.
681
 * @details This hook is invoked just before switching between threads.
682
 */
683
#if !defined(CH_CFG_CONTEXT_SWITCH_HOOK)
684
#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \
685
  /* Context switch code here.*/                                            \
686
}
687
#endif
688

    
689
/**
690
 * @brief   ISR enter hook.
691
 */
692
#if !defined(CH_CFG_IRQ_PROLOGUE_HOOK)
693
#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \
694
  /* IRQ prologue code here.*/                                              \
695
}
696
#endif
697

    
698
/**
699
 * @brief   ISR exit hook.
700
 */
701
#if !defined(CH_CFG_IRQ_EPILOGUE_HOOK)
702
#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \
703
  /* IRQ epilogue code here.*/                                              \
704
}
705
#endif
706

    
707
/**
708
 * @brief   Idle thread enter 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 activate a power saving mode.
712
 */
713
#if !defined(CH_CFG_IDLE_ENTER_HOOK)
714
#define CH_CFG_IDLE_ENTER_HOOK() {                                          \
715
  /* Idle-enter code here.*/                                                \
716
}
717
#endif
718

    
719
/**
720
 * @brief   Idle thread leave hook.
721
 * @note    This hook is invoked within a critical zone, no OS functions
722
 *          should be invoked from here.
723
 * @note    This macro can be used to deactivate a power saving mode.
724
 */
725
#if !defined(CH_CFG_IDLE_LEAVE_HOOK)
726
#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \
727
  /* Idle-leave code here.*/                                                \
728
}
729
#endif
730

    
731
/**
732
 * @brief   Idle Loop hook.
733
 * @details This hook is continuously invoked by the idle thread loop.
734
 */
735
#if !defined(CH_CFG_IDLE_LOOP_HOOK)
736
#define CH_CFG_IDLE_LOOP_HOOK() {                                           \
737
  /* Idle loop code here.*/                                                 \
738
}
739
#endif
740

    
741
/**
742
 * @brief   System tick event hook.
743
 * @details This hook is invoked in the system tick handler immediately
744
 *          after processing the virtual timers queue.
745
 */
746
#if !defined(CH_CFG_SYSTEM_TICK_HOOK)
747
#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \
748
  /* System tick event code here.*/                                         \
749
}
750
#endif
751

    
752
/**
753
 * @brief   System halt hook.
754
 * @details This hook is invoked in case to a system halting error before
755
 *          the system is halted.
756
 */
757
#if !defined(CH_CFG_SYSTEM_HALT_HOOK)
758
#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \
759
  /* System halt code here.*/                                               \
760
}
761
#endif
762

    
763
/**
764
 * @brief   Trace hook.
765
 * @details This hook is invoked each time a new record is written in the
766
 *          trace buffer.
767
 */
768
#if !defined(CH_CFG_TRACE_HOOK)
769
#define CH_CFG_TRACE_HOOK(tep) {                                            \
770
  /* Trace code here.*/                                                     \
771
}
772
#endif
773

    
774
/** @} */
775

    
776
/*===========================================================================*/
777
/**
778
 * @name Port-specific settings (override port settings defaulted in chcore.h).
779
 * @{
780
 */
781
/*===========================================================================*/
782

    
783
// These settings are specific to each module.
784

    
785
/** @} */
786

    
787
/*===========================================================================*/
788
/**
789
 * @name other
790
 * @{
791
 */
792
/*===========================================================================*/
793

    
794
/**
795
 * @brief   Flag to enable/disable floating point support in chprintf() and all deriviates.
796
 */
797
#define CHPRINTF_USE_FLOAT                  TRUE
798

    
799
/** @} */
800

    
801
#endif  /* AOS_CHCONF_H */
802

    
803
/** @} */