OS_DynTickGet
Description
OS_DynTickGet()
is part of the dynamic tick mechanism and must be implemented in the BSP. During dynamic tick operation, the kernel specifies the number of ticks, Delta1
, that must expire before an interrupt is fired. When Delta1
is specified, OS_DynTickGet()
acts as an up-counter from 0
to Delta1,
with each count representing a single tick of elapsed time. Once the count reaches Delta1
, OS_DynTickGet() must return Delta1
until a new Delta is set by the kernel. Returning a value greater than Delta1
will impact the system timing in unexpected ways, so it is critical that this restriction be followed.
Files
os.h/bsp_os.c
Prototype
OS_TICK OS_DynTickGet (void)
Arguments
None.
Returned Value
The number of ticks which have elapsed since the kernel last set a dynamic tick timeout.
Required Configuration
OS_CFG_TICK_EN
and OS_CFG_DYN_TICK_EN
must be enabled in os_cfg.h
.
Notes/Warnings
- To use the Dynamic Tick feature, the OS Board Support Package (BSP) should implement the Dynamic Tick API defined in Dynamic Tick BSP.
- Do not call
OS_DynTickGet
() from your application. OS_DynTickGet
() is always called within a critical section.- If your port supports Non-Kernel Aware interrupts, make sure that the dynamic tick interrupt is assigned a kernel-aware priority.