Kernel related settings and hooks.
◆ _CHIBIOS_RT_CONF_
#define _CHIBIOS_RT_CONF_ |
◆ _CHIBIOS_RT_CONF_VER_7_0_
#define _CHIBIOS_RT_CONF_VER_7_0_ |
◆ CH_CFG_CONTEXT_SWITCH_HOOK
#define CH_CFG_CONTEXT_SWITCH_HOOK |
( |
|
ntp, |
|
|
|
otp |
|
) |
| |
Value:
Context switch hook.
This hook is invoked just before switching between threads.
- Parameters
-
[in] | ntp | thread being switched in |
[in] | otp | thread being switched out |
Definition at line 751 of file chconf.h.
◆ CH_CFG_FACTORY_GENERIC_BUFFERS
#define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE |
Enables factory for generic buffers.
Definition at line 532 of file chconf.h.
◆ CH_CFG_FACTORY_MAILBOXES
#define CH_CFG_FACTORY_MAILBOXES TRUE |
Enables factory for mailboxes.
Definition at line 546 of file chconf.h.
◆ CH_CFG_FACTORY_MAX_NAMES_LENGTH
#define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8 |
Maximum length for object names.
If the specified length is zero then the name is stored by pointer but this could have unintended side effects.
Definition at line 518 of file chconf.h.
◆ CH_CFG_FACTORY_OBJ_FIFOS
#define CH_CFG_FACTORY_OBJ_FIFOS TRUE |
Enables factory for objects FIFOs.
Definition at line 553 of file chconf.h.
◆ CH_CFG_FACTORY_OBJECTS_REGISTRY
#define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE |
Enables the registry of generic objects.
Definition at line 525 of file chconf.h.
◆ CH_CFG_FACTORY_PIPES
#define CH_CFG_FACTORY_PIPES TRUE |
Enables factory for Pipes.
Definition at line 560 of file chconf.h.
◆ CH_CFG_FACTORY_SEMAPHORES
#define CH_CFG_FACTORY_SEMAPHORES TRUE |
Enables factory for semaphores.
Definition at line 539 of file chconf.h.
◆ CH_CFG_HARDENING_LEVEL
#define CH_CFG_HARDENING_LEVEL 0 |
Kernel hardening level.
This option is the level of functional-safety checks enabled in the kerkel. The meaning is:
- 0: No checks, maximum performance.
- 1: Reasonable checks.
- 2: All checks.
Definition at line 152 of file chconf.h.
◆ CH_CFG_IDLE_ENTER_HOOK
#define CH_CFG_IDLE_ENTER_HOOK |
( |
| ) |
|
Value:
Idle thread enter hook.
- Note
- This hook is invoked within a critical zone, no OS functions should be invoked from here.
-
This macro can be used to activate a power saving mode.
Definition at line 775 of file chconf.h.
◆ CH_CFG_IDLE_LEAVE_HOOK
#define CH_CFG_IDLE_LEAVE_HOOK |
( |
| ) |
|
Value:
Idle thread leave hook.
- Note
- This hook is invoked within a critical zone, no OS functions should be invoked from here.
-
This macro can be used to deactivate a power saving mode.
Definition at line 785 of file chconf.h.
◆ CH_CFG_IDLE_LOOP_HOOK
#define CH_CFG_IDLE_LOOP_HOOK |
( |
| ) |
|
Value:
Idle Loop hook.
This hook is continuously invoked by the idle thread loop.
Definition at line 793 of file chconf.h.
◆ CH_CFG_INTERVALS_SIZE
#define CH_CFG_INTERVALS_SIZE 32 |
Time intervals data size.
- Note
- Allowed values are 16, 32 or 64 bits.
Definition at line 83 of file chconf.h.
◆ CH_CFG_IRQ_EPILOGUE_HOOK
#define CH_CFG_IRQ_EPILOGUE_HOOK |
( |
| ) |
|
Value:
ISR exit hook.
Definition at line 765 of file chconf.h.
◆ CH_CFG_IRQ_PROLOGUE_HOOK
#define CH_CFG_IRQ_PROLOGUE_HOOK |
( |
| ) |
|
Value:
ISR enter hook.
Definition at line 758 of file chconf.h.
◆ CH_CFG_MEMCORE_SIZE
#define CH_CFG_MEMCORE_SIZE 0 |
Managed RAM size.
Size of the RAM area to be managed by the OS. If set to zero then the whole available RAM is used. The core memory is made available to the heap allocator and/or can be used directly through the simplified core memory allocator.
- Note
- In order to let the OS manage the whole RAM the linker script must provide the
heap_base
and heap_end
symbols.
-
Requires
CH_CFG_USE_MEMCORE
.
Definition at line 409 of file chconf.h.
◆ CH_CFG_NO_IDLE_THREAD
#define CH_CFG_NO_IDLE_THREAD FALSE |
Idle thread automatic spawn suppression.
When this option is activated the function chSysInit()
does not spawn the idle thread. The application main()
function becomes the idle thread and must implement an infinite loop.
Definition at line 139 of file chconf.h.
◆ CH_CFG_OPTIMIZE_SPEED
#define CH_CFG_OPTIMIZE_SPEED TRUE |
OS optimization.
If enabled then time efficient rather than space efficient code is used when two possible implementations exist.
- Note
- This is not related to the compiler optimization options.
-
The default is
TRUE
.
Definition at line 173 of file chconf.h.
◆ CH_CFG_OS_INSTANCE_EXTRA_FIELDS
#define CH_CFG_OS_INSTANCE_EXTRA_FIELDS /* Add OS instance custom fields here.*/ |
OS instance structure extension.
User fields added to the end of the os_instance_t
structure.
Definition at line 702 of file chconf.h.
◆ CH_CFG_OS_INSTANCE_INIT_HOOK
#define CH_CFG_OS_INSTANCE_INIT_HOOK |
( |
|
oip | ) |
|
Value:
OS instance initialization hook.
- Parameters
-
[in] | oip | pointer to the os_instance_t structure |
Definition at line 710 of file chconf.h.
◆ CH_CFG_RUNTIME_FAULTS_HOOK
#define CH_CFG_RUNTIME_FAULTS_HOOK |
( |
|
mask | ) |
|
Value:
Runtime Faults Collection Unit hook.
This hook is invoked each time new faults are collected and stored.
Definition at line 828 of file chconf.h.
◆ CH_CFG_SMP_MODE
#define CH_CFG_SMP_MODE FALSE |
Handling of instances.
- Note
- If enabled then threads assigned to various instances can interact each other using the same synchronization objects. If disabled then each OS instance is a separate world, no direct interactions are handled by the OS.
Definition at line 49 of file chconf.h.
◆ CH_CFG_ST_FREQUENCY
#define CH_CFG_ST_FREQUENCY 10000 |
System tick frequency.
Frequency of the system timer that drives the system ticks. This setting also defines the system tick time unit.
Definition at line 75 of file chconf.h.
◆ CH_CFG_ST_RESOLUTION
#define CH_CFG_ST_RESOLUTION 32 |
System time counter resolution.
- Note
- Allowed values are 16, 32 or 64 bits.
Definition at line 66 of file chconf.h.
◆ CH_CFG_ST_TIMEDELTA
#define CH_CFG_ST_TIMEDELTA 0 |
Time delta constant for the tick-less mode.
- Note
- If this value is zero then the system uses the classic periodic tick. This value represents the minimum number of ticks that is safe to specify in a timeout directive. The value one is not valid, timeouts are rounded up to this value.
Definition at line 103 of file chconf.h.
◆ CH_CFG_SYSTEM_EXTRA_FIELDS
#define CH_CFG_SYSTEM_EXTRA_FIELDS /* Add system custom fields here.*/ |
System structure extension.
User fields added to the end of the ch_system_t
structure.
Definition at line 686 of file chconf.h.
◆ CH_CFG_SYSTEM_HALT_HOOK
#define CH_CFG_SYSTEM_HALT_HOOK |
( |
|
reason | ) |
|
Value:
System halt hook.
This hook is invoked in case to a system halting error before the system is halted.
Definition at line 811 of file chconf.h.
◆ CH_CFG_SYSTEM_INIT_HOOK
#define CH_CFG_SYSTEM_INIT_HOOK |
( |
| ) |
|
Value:
System initialization hook.
User initialization code added to the chSysInit()
function just before interrupts are enabled globally.
Definition at line 694 of file chconf.h.
◆ CH_CFG_SYSTEM_TICK_HOOK
#define CH_CFG_SYSTEM_TICK_HOOK |
( |
| ) |
|
Value:
System tick event hook.
This hook is invoked in the system tick handler immediately after processing the virtual timers queue.
Definition at line 802 of file chconf.h.
◆ CH_CFG_THREAD_EXIT_HOOK
#define CH_CFG_THREAD_EXIT_HOOK |
( |
|
tp | ) |
|
Value:
Threads finalization hook.
User finalization code added to the chThdExit()
API.
- Parameters
-
[in] | tp | pointer to the thread_t structure |
Definition at line 740 of file chconf.h.
◆ CH_CFG_THREAD_EXTRA_FIELDS
#define CH_CFG_THREAD_EXTRA_FIELDS /* Add threads custom fields here.*/ |
Threads descriptor structure extension.
User fields added to the end of the thread_t
structure.
Definition at line 718 of file chconf.h.
◆ CH_CFG_THREAD_INIT_HOOK
#define CH_CFG_THREAD_INIT_HOOK |
( |
|
tp | ) |
|
Value:
Threads initialization hook.
User initialization code added to the _thread_init()
function.
- Note
- It is invoked from within
_thread_init()
and implicitly from all the threads creation APIs.
- Parameters
-
[in] | tp | pointer to the thread_t structure |
Definition at line 730 of file chconf.h.
◆ CH_CFG_TIME_QUANTUM
#define CH_CFG_TIME_QUANTUM 10 |
Round robin interval.
This constant is the number of system ticks allowed for the threads before preemption occurs. Setting this value to zero disables the preemption for threads with equal priority and the round robin becomes cooperative. Note that higher priority threads can still preempt, the kernel is always preemptive.
- Note
- Disabling the round robin preemption makes the kernel more compact and generally faster.
-
The round robin preemption is not supported in tickless mode and must be set to zero in that case.
Definition at line 128 of file chconf.h.
◆ CH_CFG_TIME_TYPES_SIZE
#define CH_CFG_TIME_TYPES_SIZE 32 |
Time types data size.
- Note
- Allowed values are 16 or 32 bits.
Definition at line 91 of file chconf.h.
◆ CH_CFG_TRACE_HOOK
#define CH_CFG_TRACE_HOOK |
( |
|
tep | ) |
|
Value:
Trace hook.
This hook is invoked each time a new record is written in the trace buffer.
Definition at line 820 of file chconf.h.
◆ CH_CFG_USE_CONDVARS
#define CH_CFG_USE_CONDVARS TRUE |
Conditional Variables APIs.
If enabled then the conditional variables APIs are included in the kernel.
- Note
- The default is
TRUE
.
-
Requires
CH_CFG_USE_MUTEXES
.
Definition at line 281 of file chconf.h.
◆ CH_CFG_USE_CONDVARS_TIMEOUT
#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE |
Conditional Variables APIs with timeout.
If enabled then the conditional variables APIs with timeout specification are included in the kernel.
- Note
- The default is
TRUE
.
-
Requires
CH_CFG_USE_CONDVARS
.
Definition at line 293 of file chconf.h.
◆ CH_CFG_USE_DELEGATES
#define CH_CFG_USE_DELEGATES TRUE |
Delegate threads APIs.
If enabled then the delegate threads APIs are included in the kernel.
- Note
- The default is
TRUE
.
Definition at line 478 of file chconf.h.
◆ CH_CFG_USE_DYNAMIC
#define CH_CFG_USE_DYNAMIC TRUE |
Dynamic Threads APIs.
If enabled then the dynamic threads creation APIs are included in the kernel.
- Note
- The default is
TRUE
.
-
Requires
CH_CFG_USE_WAITEXIT
.
-
Requires
CH_CFG_USE_HEAP
and/or CH_CFG_USE_MEMPOOLS
.
Definition at line 352 of file chconf.h.
◆ CH_CFG_USE_EVENTS
#define CH_CFG_USE_EVENTS TRUE |
Events Flags APIs.
If enabled then the event flags APIs are included in the kernel.
- Note
- The default is
TRUE
.
Definition at line 303 of file chconf.h.
◆ CH_CFG_USE_EVENTS_TIMEOUT
#define CH_CFG_USE_EVENTS_TIMEOUT TRUE |
Events Flags APIs with timeout.
If enabled then the events APIs with timeout specification are included in the kernel.
- Note
- The default is
TRUE
.
-
Requires
CH_CFG_USE_EVENTS
.
Definition at line 315 of file chconf.h.
◆ CH_CFG_USE_FACTORY
#define CH_CFG_USE_FACTORY TRUE |
Objects Factory APIs.
If enabled then the objects factory APIs are included in the kernel.
- Note
- The default is
FALSE
.
Definition at line 509 of file chconf.h.
◆ CH_CFG_USE_HEAP
#define CH_CFG_USE_HEAP TRUE |
Heap Allocator APIs.
If enabled then the memory heap allocator APIs are included in the kernel.
- Note
- The default is
TRUE
.
-
Requires
CH_CFG_USE_MEMCORE
and either CH_CFG_USE_MUTEXES
or CH_CFG_USE_SEMAPHORES
.
-
Mutexes are recommended.
Definition at line 423 of file chconf.h.
◆ CH_CFG_USE_JOBS
#define CH_CFG_USE_JOBS TRUE |
Jobs Queues APIs.
If enabled then the jobs queues APIs are included in the kernel.
- Note
- The default is
TRUE
.
Definition at line 489 of file chconf.h.
◆ CH_CFG_USE_MAILBOXES
#define CH_CFG_USE_MAILBOXES TRUE |
Mailboxes APIs.
If enabled then the asynchronous messages (mailboxes) APIs are included in the kernel.
- Note
- The default is
TRUE
.
-
Requires
CH_CFG_USE_SEMAPHORES
.
Definition at line 373 of file chconf.h.
◆ CH_CFG_USE_MEMCHECKS
#define CH_CFG_USE_MEMCHECKS TRUE |
Memory checks APIs.
If enabled then the memory checks APIs are included in the kernel.
- Note
- The default is
TRUE
.
Definition at line 383 of file chconf.h.
◆ CH_CFG_USE_MEMCORE
#define CH_CFG_USE_MEMCORE TRUE |
Core Memory Manager APIs.
If enabled then the core memory manager APIs are included in the kernel.
- Note
- The default is
TRUE
.
Definition at line 394 of file chconf.h.
◆ CH_CFG_USE_MEMPOOLS
#define CH_CFG_USE_MEMPOOLS TRUE |
Memory Pools Allocator APIs.
If enabled then the memory pools allocator APIs are included in the kernel.
- Note
- The default is
TRUE
.
Definition at line 434 of file chconf.h.
◆ CH_CFG_USE_MESSAGES
#define CH_CFG_USE_MESSAGES TRUE |
Synchronous Messages APIs.
If enabled then the synchronous messages APIs are included in the kernel.
- Note
- The default is
TRUE
.
Definition at line 326 of file chconf.h.
◆ CH_CFG_USE_MESSAGES_PRIORITY
#define CH_CFG_USE_MESSAGES_PRIORITY FALSE |
Synchronous Messages queuing mode.
If enabled then messages are served by priority rather than in FIFO order.
- Note
- The default is
FALSE
. Enable this if you have special requirements.
-
Requires
CH_CFG_USE_MESSAGES
.
Definition at line 339 of file chconf.h.
◆ CH_CFG_USE_MUTEXES
#define CH_CFG_USE_MUTEXES TRUE |
Mutexes APIs.
If enabled then the mutexes APIs are included in the kernel.
- Note
- The default is
TRUE
.
Definition at line 257 of file chconf.h.
◆ CH_CFG_USE_MUTEXES_RECURSIVE
#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE |
Enables recursive behavior on mutexes.
- Note
- Recursive mutexes are heavier and have an increased memory footprint.
-
The default is
FALSE
.
-
Requires
CH_CFG_USE_MUTEXES
.
Definition at line 269 of file chconf.h.
◆ CH_CFG_USE_OBJ_CACHES
#define CH_CFG_USE_OBJ_CACHES TRUE |
Objects Caches APIs.
If enabled then the objects caches APIs are included in the kernel.
- Note
- The default is
TRUE
.
Definition at line 467 of file chconf.h.
◆ CH_CFG_USE_OBJ_FIFOS
#define CH_CFG_USE_OBJ_FIFOS TRUE |
Objects FIFOs APIs.
If enabled then the objects FIFOs APIs are included in the kernel.
- Note
- The default is
TRUE
.
Definition at line 445 of file chconf.h.
◆ CH_CFG_USE_PIPES
#define CH_CFG_USE_PIPES TRUE |
Pipes APIs.
If enabled then the pipes APIs are included in the kernel.
- Note
- The default is
TRUE
.
Definition at line 456 of file chconf.h.
◆ CH_CFG_USE_REGISTRY
#define CH_CFG_USE_REGISTRY TRUE |
Threads registry APIs.
If enabled then the registry APIs are included in the kernel.
- Note
- The default is
TRUE
.
Definition at line 213 of file chconf.h.
◆ CH_CFG_USE_SEMAPHORES
#define CH_CFG_USE_SEMAPHORES TRUE |
Semaphores APIs.
If enabled then the Semaphores APIs are included in the kernel.
- Note
- The default is
TRUE
.
Definition at line 234 of file chconf.h.
◆ CH_CFG_USE_SEMAPHORES_PRIORITY
#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE |
Semaphores queuing mode.
If enabled then the threads are enqueued on semaphores by priority rather than in FIFO order.
- Note
- The default is
FALSE
. Enable this if you have special requirements.
-
Requires
CH_CFG_USE_SEMAPHORES
.
Definition at line 247 of file chconf.h.
◆ CH_CFG_USE_TIMESTAMP
#define CH_CFG_USE_TIMESTAMP TRUE |
Time Stamps APIs.
If enabled then the time stamps APIs are included in the kernel.
- Note
- The default is
TRUE
.
Definition at line 203 of file chconf.h.
◆ CH_CFG_USE_TM
#define CH_CFG_USE_TM TRUE |
Time Measurement APIs.
If enabled then the time measurement APIs are included in the kernel.
- Note
- The default is
TRUE
.
Definition at line 193 of file chconf.h.
◆ CH_CFG_USE_WAITEXIT
#define CH_CFG_USE_WAITEXIT TRUE |
Threads synchronization APIs.
If enabled then the chThdWait()
function is included in the kernel.
- Note
- The default is
TRUE
.
Definition at line 224 of file chconf.h.
◆ CH_DBG_ENABLE_ASSERTS
#define CH_DBG_ENABLE_ASSERTS FALSE |
Debug option, consistency checks.
If enabled then all the assertions in the kernel code are activated. This includes consistency checks inside the kernel, runtime anomalies and port-defined checks.
- Note
- The default is
FALSE
.
Definition at line 612 of file chconf.h.
◆ CH_DBG_ENABLE_CHECKS
#define CH_DBG_ENABLE_CHECKS FALSE |
Debug option, parameters checks.
If enabled then the checks on the API functions input parameters are activated.
- Note
- The default is
FALSE
.
Definition at line 600 of file chconf.h.
◆ CH_DBG_ENABLE_STACK_CHECK
#define CH_DBG_ENABLE_STACK_CHECK FALSE |
Debug option, stack checks.
If enabled then a runtime stack check is performed.
- Note
- The default is
FALSE
.
-
The stack check is performed in a architecture/port dependent way. It may not be implemented or some ports.
-
The default failure mode is to halt the system with the global
panic_msg
variable set to NULL
.
Definition at line 645 of file chconf.h.
◆ CH_DBG_FILL_THREADS
#define CH_DBG_FILL_THREADS FALSE |
Debug option, stacks initialization.
If enabled then the threads working area is filled with a byte value when a thread is created. This can be useful for the runtime measurement of the used stack.
- Note
- The default is
FALSE
.
Definition at line 657 of file chconf.h.
◆ CH_DBG_STATISTICS
#define CH_DBG_STATISTICS FALSE |
Debug option, kernel statistics.
- Note
- The default is
FALSE
.
Definition at line 578 of file chconf.h.
◆ CH_DBG_SYSTEM_STATE_CHECK
#define CH_DBG_SYSTEM_STATE_CHECK FALSE |
Debug option, system state check.
If enabled the correct call protocol for system APIs is checked at runtime.
- Note
- The default is
FALSE
.
Definition at line 589 of file chconf.h.
◆ CH_DBG_THREADS_PROFILING
#define CH_DBG_THREADS_PROFILING FALSE |
Debug option, threads profiling.
If enabled then a field is added to the thread_t
structure that counts the system ticks occurred while executing the thread.
- Note
- The default is
FALSE
.
-
This debug option is not currently compatible with the tickless mode.
Definition at line 670 of file chconf.h.
◆ CH_DBG_TRACE_BUFFER_SIZE
#define CH_DBG_TRACE_BUFFER_SIZE 128 |
Trace buffer entries.
- Note
- The trace buffer is only allocated if
CH_DBG_TRACE_MASK
is different from CH_DBG_TRACE_MASK_DISABLED
.
Definition at line 631 of file chconf.h.
◆ CH_DBG_TRACE_MASK
#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED |
Debug option, trace buffer.
If enabled then the trace buffer is activated.
- Note
- The default is
CH_DBG_TRACE_MASK_DISABLED
.
Definition at line 622 of file chconf.h.
◆ CHPRINTF_USE_FLOAT
#define CHPRINTF_USE_FLOAT 1 |