Main Page   Modules   Data Structures   File List   Globals  

Time Management


Modules

Internal Time Management Functions

Defines

#define TICKS_PER_SEC   256
 Number of otOS system ticks per second.

#define MS10   (TICKS_PER_SEC / 100)
#define MS20   (TICKS_PER_SEC / 50)
#define MS50   (TICKS_PER_SEC / 20)
#define MS100   (TICKS_PER_SEC / 10)
#define MS125   (TICKS_PER_SEC / 8)
#define MS200   (TICKS_PER_SEC / 5)
#define MS250   (TICKS_PER_SEC / 4)
#define MS500   (TICKS_PER_SEC / 2)
#define MS1000   TICKS_PER_SEC
#define SEC1   TICKS_PER_SEC
#define SEC2   (TICKS_PER_SEC * 2)
#define SEC5   (TICKS_PER_SEC * 5)
#define SEC10   (TICKS_PER_SEC * 10)
#define SEC20   (TICKS_PER_SEC * 20)
#define SEC30   (TICKS_PER_SEC * 30)
#define SEC40   (TICKS_PER_SEC * 40)
#define SEC50   (TICKS_PER_SEC * 50)
#define SEC60   (TICKS_PER_SEC * 60)
#define MIN1   (TICKS_PER_SEC * 60)
#define MIN2   (MIN1 * 2)
#define MIN5   (MIN1 * 5)
#define MIN10   (MIN1 * 10)
#define INFINITE   0xffffffffL

Functions

uint32_t otosGetTicks (void)
 Get the system tick counter.

void otosSleep (uint32_t ticks)
 Block running task for specified number of ticks.

void otosDelay (uint32_t ticks)
 Delay running task for specified number of ticks (wait actively, don't block task!).

void otosSetTickHook (void(*pFunc)(void))
 Set tick hook function.

uint32_t otosGetTickDiff (uint32_t earlier)
 Calculate time difference between an earlier time and now.


Detailed Description

Time Management

Function Documentation

void otosDelay uint32_t    ticks
 

Delay running task for specified number of ticks (wait actively, don't block task!).

Parameters:
ticks Number of system ticks to wait

Definition at line 111 of file time.c.

References otosGetTickDiff(), and otosGetTicks().

uint32_t otosGetTickDiff uint32_t    earlier
 

Calculate time difference between an earlier time and now.

Parameters:
earlier earlier time (in ticks)

Definition at line 149 of file time.c.

References otosGetTicks().

Referenced by otosDelay(), and otosScheduler().

uint32_t otosGetTicks void    [inline]
 

Get the system tick counter.

The system tick counter is incremented TICKS_PER_SEC times per second.

Returns:
Number of system ticks elapsed since the start of the system.

Definition at line 69 of file time.c.

Referenced by main(), otosDelay(), otosGetTickDiff(), and otosScheduler().

void otosSetTickHook void(*    pFunc)(void) [inline]
 

Set tick hook function.

The tick hook function will be called by the system tick handler with a frequency of TICKS_PER_SEC Hz.

Parameters:
pFunc Pointer to tick hook function

Definition at line 130 of file time.c.

void otosSleep uint32_t    ticks
 

Block running task for specified number of ticks.

If ticks is zero, immediately call scheduler

Parameters:
ticks Number of system ticks to sleep

Definition at line 92 of file time.c.

References g_pRunningTask, otosBlock, and otosScheduler().


Generated on Sat Jan 25 18:41:43 2003 for otOS by doxygen1.3-rc2