#include <nitro/os.h>
void OS_InitTick( void );
None.
None.
This function allocates a timer for ticks and initializes it.
Ticks are a method of using a hardware timer to generate a u64
increment count. A tick is also the obtained value. Although the timer itself is 16 bits, in addition to the 16-bit cycle, which is one unit, there is also an internal counter. As a result it creates a 64-bit tick value. (The frequency of the system clock is OS_SYSTEM_CLOCK
Hz, so ticks run at OS_SYSTEM_CLOCK
/ 64 Hz.)
The OS_InitTick
function internally sets the tick value to 0. Therefore it is possible to assume that the value obtained with the OS_GetTick
function is the time since OS_InitTick()
.
A timer that is allocated for ticks becomes system-reserved. A user cannot use it as a timer with the OS_StartTimer
function or similar functions. Do not call the OS_InitTick
function if the user wants to use all of the timers.
Ticks are necessary when you use the alarm system. Call OS_InitTick()
before calling the alarm system initialization declaration function OS_InitAlarm
.
OS_GetTick, OS_GetTickLo, OS_SetTick, OS_InitAlarm
2004/02/25 Changed systemClock
to tick
.
2004/02/04 Initial version.
CONFIDENTIAL