Statistics
| Branch: | Tag: | Revision:

amiro-os / modules / aos_chconf.h @ e7c4f797

History | View | Annotate | Download (23.054 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
#if ((AMIROOS_CFG_DBG == true) || (AMIROOS_CFG_PROFILE == true)) || defined(__DOXYGEN__)
169
  #define CH_CFG_USE_TM                     TRUE
170
#else
171
  #define CH_CFG_USE_TM                     FALSE
172
#endif
173
#endif
174

    
175
/**
176
 * @brief   Threads registry APIs.
177
 * @details If enabled then the registry APIs are included in the kernel.
178
 *
179
 * @note    The default is @p TRUE.
180
 */
181
#if !defined(CH_CFG_USE_REGISTRY)
182
#define CH_CFG_USE_REGISTRY                 FALSE
183
#endif
184

    
185
/**
186
 * @brief   Thread hierarchy APIs.
187
 * @details Id enabled then the thread hierarchy APIs are included in the kernel.
188
 *
189
 * @note    The default is @p FALSE.
190
 */
191
#if !defined(CH_CFG_USE_THREADHIERARCHY)
192
#define CH_CFG_USE_THREADHIERARCHY          TRUE
193
#endif
194

    
195
/**
196
 * @brief   Enable ordering of child lists.
197
 * @details Children will be ordered by their priority (descending).
198
 *          If sibliblings have identical priority, they are ordered by age (descending).
199
 */
200
#if !defined(CH_CFG_THREADHIERARCHY_ORDERED)
201
#define CH_CFG_THREADHIERARCHY_ORDERED      TRUE
202
#endif
203

    
204
/**
205
 * @brief   Threads synchronization APIs.
206
 * @details If enabled then the @p chThdWait() function is included in
207
 *          the kernel.
208
 *
209
 * @note    The default is @p TRUE.
210
 */
211
#if !defined(CH_CFG_USE_WAITEXIT)
212
#define CH_CFG_USE_WAITEXIT                 TRUE
213
#endif
214

    
215
/**
216
 * @brief   Semaphores APIs.
217
 * @details If enabled then the Semaphores APIs are included in the kernel.
218
 *
219
 * @note    The default is @p TRUE.
220
 */
221
#if !defined(CH_CFG_USE_SEMAPHORES)
222
#define CH_CFG_USE_SEMAPHORES               TRUE
223
#endif
224

    
225
/**
226
 * @brief   Semaphores queuing mode.
227
 * @details If enabled then the threads are enqueued on semaphores by
228
 *          priority rather than in FIFO order.
229
 *
230
 * @note    The default is @p FALSE. Enable this if you have special
231
 *          requirements.
232
 * @note    Requires @p CH_CFG_USE_SEMAPHORES.
233
 */
234
#if !defined(CH_CFG_USE_SEMAPHORES_PRIORITY)
235
#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE
236
#endif
237

    
238
/**
239
 * @brief   Mutexes APIs.
240
 * @details If enabled then the mutexes APIs are included in the kernel.
241
 *
242
 * @note    The default is @p TRUE.
243
 */
244
#if !defined(CH_CFG_USE_MUTEXES)
245
#define CH_CFG_USE_MUTEXES                  TRUE
246
#endif
247

    
248
/**
249
 * @brief   Enables recursive behavior on mutexes.
250
 * @note    Recursive mutexes are heavier and have an increased
251
 *          memory footprint.
252
 *
253
 * @note    The default is @p FALSE.
254
 * @note    Requires @p CH_CFG_USE_MUTEXES.
255
 */
256
#if !defined(CH_CFG_USE_MUTEXES_RECURSIVE)
257
#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE
258
#endif
259

    
260
/**
261
 * @brief   Conditional Variables APIs.
262
 * @details If enabled then the conditional variables APIs are included
263
 *          in the kernel.
264
 *
265
 * @note    The default is @p TRUE.
266
 * @note    Requires @p CH_CFG_USE_MUTEXES.
267
 */
268
#if !defined(CH_CFG_USE_CONDVARS)
269
#define CH_CFG_USE_CONDVARS                 TRUE
270
#endif
271

    
272
/**
273
 * @brief   Conditional Variables APIs with timeout.
274
 * @details If enabled then the conditional variables APIs with timeout
275
 *          specification are included in the kernel.
276
 *
277
 * @note    The default is @p FALSE.
278
 * @note    Requires @p CH_CFG_USE_CONDVARS.
279
 */
280
#if !defined(CH_CFG_USE_CONDVARS_TIMEOUT)
281
#define CH_CFG_USE_CONDVARS_TIMEOUT         FALSE
282
#endif
283

    
284
/**
285
 * @brief   Events Flags APIs.
286
 * @details If enabled then the event flags APIs are included in the kernel.
287
 *
288
 * @note    The default is @p TRUE.
289
 */
290
#if !defined(CH_CFG_USE_EVENTS)
291
#define CH_CFG_USE_EVENTS                   TRUE
292
#endif
293

    
294
/**
295
 * @brief   Events Flags APIs with timeout.
296
 * @details If enabled then the events APIs with timeout specification
297
 *          are included in the kernel.
298
 *
299
 * @note    The default is @p TRUE.
300
 * @note    Requires @p CH_CFG_USE_EVENTS.
301
 */
302
#if !defined(CH_CFG_USE_EVENTS_TIMEOUT)
303
#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE
304
#endif
305

    
306
/**
307
 * @brief   Synchronous Messages APIs.
308
 * @details If enabled then the synchronous messages APIs are included
309
 *          in the kernel.
310
 *
311
 * @note    The default is @p TRUE.
312
 */
313
#if !defined(CH_CFG_USE_MESSAGES)
314
#define CH_CFG_USE_MESSAGES                 FALSE
315
#endif
316

    
317
/**
318
 * @brief   Synchronous Messages queuing mode.
319
 * @details If enabled then messages are served by priority rather than in
320
 *          FIFO order.
321
 *
322
 * @note    The default is @p FALSE. Enable this if you have special
323
 *          requirements.
324
 * @note    Requires @p CH_CFG_USE_MESSAGES.
325
 */
326
#if !defined(CH_CFG_USE_MESSAGES_PRIORITY)
327
#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE
328
#endif
329

    
330
/**
331
 * @brief   Mailboxes APIs.
332
 * @details If enabled then the asynchronous messages (mailboxes) APIs are
333
 *          included in the kernel.
334
 *
335
 * @note    The default is @p TRUE.
336
 * @note    Requires @p CH_CFG_USE_SEMAPHORES.
337
 */
338
#if !defined(CH_CFG_USE_MAILBOXES)
339
#define CH_CFG_USE_MAILBOXES                FALSE
340
#endif
341

    
342
/**
343
 * @brief   Core Memory Manager APIs.
344
 * @details If enabled then the core memory manager APIs are included
345
 *          in the kernel.
346
 *
347
 * @note    The default is @p TRUE.
348
 */
349
#if !defined(CH_CFG_USE_MEMCORE)
350
#define CH_CFG_USE_MEMCORE                  FALSE
351
#endif
352

    
353
/**
354
 * @brief   Heap Allocator APIs.
355
 * @details If enabled then the memory heap allocator APIs are included
356
 *          in the kernel.
357
 *
358
 * @note    The default is @p TRUE.
359
 * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
360
 *          @p CH_CFG_USE_SEMAPHORES.
361
 * @note    Mutexes are recommended.
362
 */
363
#if !defined(CH_CFG_USE_HEAP)
364
#define CH_CFG_USE_HEAP                     FALSE
365
#endif
366

    
367
/**
368
 * @brief   Memory Pools Allocator APIs.
369
 * @details If enabled then the memory pools allocator APIs are included
370
 *          in the kernel.
371
 *
372
 * @note    The default is @p TRUE.
373
 */
374
#if !defined(CH_CFG_USE_MEMPOOLS)
375
#define CH_CFG_USE_MEMPOOLS                 FALSE
376
#endif
377

    
378
/**
379
 * @brief   Objects FIFOs APIs.
380
 * @details If enabled then the objects FIFOs APIs are included
381
 *          in the kernel.
382
 *
383
 * @note    The default is @p TRUE.
384
 */
385
#if !defined(CH_CFG_USE_OBJ_FIFOS)
386
#define CH_CFG_USE_OBJ_FIFOS                FALSE
387
#endif
388

    
389
/**
390
 * @brief   Pipes APIs.
391
 * @details If enabled then the pipes APIs are included
392
 *          in the kernel.
393
 *
394
 * @note    The default is @p TRUE.
395
 */
396
#if !defined(CH_CFG_USE_PIPES)
397
#define CH_CFG_USE_PIPES                    FALSE
398
#endif
399

    
400
/**
401
 * @brief   Dynamic Threads APIs.
402
 * @details If enabled then the dynamic threads creation APIs are included
403
 *          in the kernel.
404
 *
405
 * @note    The default is @p TRUE.
406
 * @note    Requires @p CH_CFG_USE_WAITEXIT.
407
 * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
408
 */
409
#if !defined(CH_CFG_USE_DYNAMIC)
410
#define CH_CFG_USE_DYNAMIC                  FALSE
411
#endif
412

    
413
/** @} */
414

    
415
/*===========================================================================*/
416
/**
417
 * @name Objects factory options
418
 * @{
419
 */
420
/*===========================================================================*/
421

    
422
/**
423
 * @brief   Objects Factory APIs.
424
 * @details If enabled then the objects factory APIs are included in the
425
 *          kernel.
426
 *
427
 * @note    The default is @p FALSE.
428
 */
429
#if !defined(CH_CFG_USE_FACTORY)
430
#define CH_CFG_USE_FACTORY                  FALSE
431
#endif
432

    
433
/**
434
 * @brief   Maximum length for object names.
435
 * @details If the specified length is zero then the name is stored by
436
 *          pointer but this could have unintended side effects.
437
 */
438
#if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH)
439
#define CH_CFG_FACTORY_MAX_NAMES_LENGTH     8
440
#endif
441

    
442
/**
443
 * @brief   Enables the registry of generic objects.
444
 */
445
#if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY)
446
#define CH_CFG_FACTORY_OBJECTS_REGISTRY     TRUE
447
#endif
448

    
449
/**
450
 * @brief   Enables factory for generic buffers.
451
 */
452
#if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS)
453
#define CH_CFG_FACTORY_GENERIC_BUFFERS      TRUE
454
#endif
455

    
456
/**
457
 * @brief   Enables factory for semaphores.
458
 */
459
#if !defined(CH_CFG_FACTORY_SEMAPHORES)
460
#define CH_CFG_FACTORY_SEMAPHORES           TRUE
461
#endif
462

    
463
/**
464
 * @brief   Enables factory for mailboxes.
465
 */
466
#if !defined(CH_CFG_FACTORY_MAILBOXES)
467
#define CH_CFG_FACTORY_MAILBOXES            TRUE
468
#endif
469

    
470
/**
471
 * @brief   Enables factory for objects FIFOs.
472
 */
473
#if !defined(CH_CFG_FACTORY_OBJ_FIFOS)
474
#define CH_CFG_FACTORY_OBJ_FIFOS            TRUE
475
#endif
476

    
477
/**
478
 * @brief   Enables factory for Pipes.
479
 */
480
#if !defined(CH_CFG_FACTORY_PIPES) || defined(__DOXYGEN__)
481
#define CH_CFG_FACTORY_PIPES                TRUE
482
#endif
483

    
484
/** @} */
485

    
486
/*===========================================================================*/
487
/**
488
 * @name Debug options
489
 * @{
490
 */
491
/*===========================================================================*/
492

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

    
506
/**
507
 * @brief   Debug option, system state check.
508
 * @details If enabled the correct call protocol for system APIs is checked
509
 *          at runtime.
510
 *
511
 * @note    The default is @p FALSE.
512
 */
513
#if !defined(CH_DBG_SYSTEM_STATE_CHECK)
514
#if (AMIROOS_CFG_DBG == true) || defined(__DOXYGEN__)
515
  #define CH_DBG_SYSTEM_STATE_CHECK         TRUE
516
#else
517
  #define CH_DBG_SYSTEM_STATE_CHECK         FALSE
518
#endif
519
#endif
520

    
521
/**
522
 * @brief   Debug option, parameters checks.
523
 * @details If enabled then the checks on the API functions input
524
 *          parameters are activated.
525
 *
526
 * @note    The default is @p FALSE.
527
 */
528
#if !defined(CH_DBG_ENABLE_CHECKS)
529
#if (AMIROOS_CFG_DBG == true) || defined(__DOXYGEN__)
530
  #define CH_DBG_ENABLE_CHECKS              TRUE
531
#else
532
  #define CH_DBG_ENABLE_CHECKS              FALSE
533
#endif
534
#endif
535

    
536
/**
537
 * @brief   Debug option, consistency checks.
538
 * @details If enabled then all the assertions in the kernel code are
539
 *          activated. This includes consistency checks inside the kernel,
540
 *          runtime anomalies and port-defined checks.
541
 *
542
 * @note    The default is @p FALSE.
543
 */
544
#if !defined(CH_DBG_ENABLE_ASSERTS)
545
#if (AMIROOS_CFG_DBG == true) || defined(__DOXYGEN__)
546
  #define CH_DBG_ENABLE_ASSERTS             TRUE
547
#else
548
  #define CH_DBG_ENABLE_ASSERTS             FALSE
549
#endif
550
#endif
551

    
552
/**
553
 * @brief   Debug option, trace buffer.
554
 * @details If enabled then the trace buffer is activated.
555
 *
556
 * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.
557
 */
558
#if !defined(CH_DBG_TRACE_MASK)
559
#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED
560
#endif
561

    
562
/**
563
 * @brief   Trace buffer entries.
564
 * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
565
 *          different from @p CH_DBG_TRACE_MASK_DISABLED.
566
 */
567
#if !defined(CH_DBG_TRACE_BUFFER_SIZE)
568
#define CH_DBG_TRACE_BUFFER_SIZE            128
569
#endif
570

    
571
/**
572
 * @brief   Debug option, stack checks.
573
 * @details If enabled then a runtime stack check is performed.
574
 *
575
 * @note    The default is @p FALSE.
576
 * @note    The stack check is performed in a architecture/port dependent way.
577
 *          It may not be implemented or some ports.
578
 * @note    The default failure mode is to halt the system with the global
579
 *          @p panic_msg variable set to @p NULL.
580
 */
581
#if !defined(CH_DBG_ENABLE_STACK_CHECK)
582
#if (AMIROOS_CFG_DBG == true) || defined(__DOXYGEN__)
583
  #define CH_DBG_ENABLE_STACK_CHECK         TRUE
584
#else
585
  #define CH_DBG_ENABLE_STACK_CHECK         FALSE
586
#endif
587
#endif
588

    
589
/**
590
 * @brief   Debug option, stacks initialization.
591
 * @details If enabled then the threads working area is filled with a byte
592
 *          value when a thread is created. This can be useful for the
593
 *          runtime measurement of the used stack.
594
 *
595
 * @note    The default is @p FALSE.
596
 */
597
#if !defined(CH_DBG_FILL_THREADS)
598
#if (AMIROOS_CFG_PROFILE == true) || defined(__DOXYGEN__)
599
  #define CH_DBG_FILL_THREADS               TRUE
600
#else
601
  #define CH_DBG_FILL_THREADS               FALSE
602
#endif
603
#endif
604

    
605
/**
606
 * @brief   Debug option, threads profiling.
607
 * @details If enabled then a field is added to the @p thread_t structure that
608
 *          counts the system ticks occurred while executing the thread.
609
 *
610
 * @note    The default is @p FALSE.
611
 * @note    This debug option is not currently compatible with the
612
 *          tickless mode.
613
 */
614
#if !defined(CH_DBG_THREADS_PROFILING)
615
#if ((CH_CFG_ST_TIMEDELTA == 0) && (AMIROOS_CFG_PROFILE == true)) || defined(__DOXYGEN__)
616
  #define CH_DBG_THREADS_PROFILING          TRUE
617
#else
618
  #define CH_DBG_THREADS_PROFILING          FALSE
619
#endif
620
#endif
621

    
622
/** @} */
623

    
624
/*===========================================================================*/
625
/**
626
 * @name Kernel hooks
627
 * @{
628
 */
629
/*===========================================================================*/
630

    
631
/**
632
 * @brief   System structure extension.
633
 * @details User fields added to the end of the @p ch_system_t structure.
634
 */
635
#if !defined(CH_CFG_SYSTEM_EXTRA_FIELDS)
636
#define CH_CFG_SYSTEM_EXTRA_FIELDS                                          \
637
  /* Add threads custom fields here.*/
638
#endif
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
#if !defined(CH_CFG_SYSTEM_INIT_HOOK)
646
#define CH_CFG_SYSTEM_INIT_HOOK() {                                         \
647
  /* Add threads initialization code here.*/                                \
648
}
649
#endif
650

    
651
/**
652
 * @brief   Threads descriptor structure extension.
653
 * @details User fields added to the end of the @p thread_t structure.
654
 */
655
#if !defined(CH_CFG_THREAD_EXTRA_FIELDS)
656
#define CH_CFG_THREAD_EXTRA_FIELDS                                          \
657
  /* Add threads custom fields here.*/
658
#endif
659

    
660
/**
661
 * @brief   Threads initialization hook.
662
 * @details User initialization code added to the @p _thread_init() function.
663
 *
664
 * @note    It is invoked from within @p _thread_init() and implicitly from all
665
 *          the threads creation APIs.
666
 */
667
#if !defined(CH_CFG_THREAD_INIT_HOOK)
668
#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
669
  /* Add threads initialization code here.*/                                \
670
}
671
#endif
672

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

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

    
693
/**
694
 * @brief   ISR enter hook.
695
 */
696
#if !defined(CH_CFG_IRQ_PROLOGUE_HOOK)
697
#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \
698
  /* IRQ prologue code here.*/                                              \
699
}
700
#endif
701

    
702
/**
703
 * @brief   ISR exit hook.
704
 */
705
#if !defined(CH_CFG_IRQ_EPILOGUE_HOOK)
706
#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \
707
  /* IRQ epilogue code here.*/                                              \
708
}
709
#endif
710

    
711
/**
712
 * @brief   Idle thread enter hook.
713
 * @note    This hook is invoked within a critical zone, no OS functions
714
 *          should be invoked from here.
715
 * @note    This macro can be used to activate a power saving mode.
716
 */
717
#if !defined(CH_CFG_IDLE_ENTER_HOOK)
718
#define CH_CFG_IDLE_ENTER_HOOK() {                                          \
719
  /* Idle-enter code here.*/                                                \
720
}
721
#endif
722

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

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

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

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

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

    
778
/** @} */
779

    
780
/*===========================================================================*/
781
/**
782
 * @name Port-specific settings (override port settings defaulted in chcore.h).
783
 * @{
784
 */
785
/*===========================================================================*/
786

    
787
// These settings are specific to each module.
788

    
789
/** @} */
790

    
791
/*===========================================================================*/
792
/**
793
 * @name other
794
 * @{
795
 */
796
/*===========================================================================*/
797

    
798
/**
799
 * @brief   Flag to enable/disable floating point support in chprintf() and all deriviates.
800
 */
801
#define CHPRINTF_USE_FLOAT                  TRUE
802

    
803
/** @} */
804

    
805
#endif  /* AOS_CHCONF_H */
806

    
807
/** @} */