OS_TicksTo*Seconds


C Specification

#include <nitro/os.h>
OS_TicksToMicroSeconds( tick )
OS_TicksToMilliSeconds( tick )
OS_TicksToSeconds( tick )

Description

This function obtains the actual time that corresponds to the tick value that is specified in the argument. One tick unit is 1/64 of the system clock.

OS_TicksToMicroSeconds() converts the tick value to microseconds.
OS_TicksToMilliSeconds() converts the tick value to milliseconds.
OS_TicksToSeconds() converts the tick value to seconds.

The conversion macro is as follows.

#define OS_TicksToMicroSeconds( tick ) \
( ((tick) * 64 * 1000 / (OS_TIMER_CLOCK/1000) )

#define OS_TicksToMilliSeconds( tick ) \
( ((tick) * 64) / (OS_TIMER_CLOCK/1000) )

#define OS_TickToSeconds( tick ) \
( ((tick) * 64) / OS_SYSTEM_CLOCK )


Note:  The OS_SYSTEM_CLOCK is 33514000.

Arguments

tick The tick value

Return Values

The actual time that corresponds to the tick value that is specified in the argument.

See Also

OS_InitTick, OS_GetTick, OS_SetAlarm, OS_SetPeriodicAlarm, OS_*SecondsToTicks

Revision History

02/25/2004 Changed Count -> Tick
02/24/2004 Initial Version