Defines | |
| #define | HZ (timerticks per second) |
| #define | POS_TIMEAFTER(x, y) ((((SJIF_t)(x)) - ((SJIF_t)(y))) >= 0) |
Functions | |
| POSEXTERN POSTIMER_t | posTimerCreate (void) |
| POSEXTERN VAR_t | posTimerSet (POSTIMER_t tmr, POSSEMA_t sema, UINT_t waitticks, UINT_t periodticks) |
| POSEXTERN VAR_t | posTimerStart (POSTIMER_t tmr) |
| POSEXTERN VAR_t | posTimerStop (POSTIMER_t tmr) |
| POSEXTERN void | posTimerDestroy (POSTIMER_t tmr) |
| POSEXTERN VAR_t | posTimerFired (POSTIMER_t tmr) |
Variables | |
| POSEXTERN volatile JIF_t | jiffies |
| Global timer variable. The jiffies counter variable is incremented HZ times per second. | |
|
|
Hertz, timer ticks per second. HZ is a define that is set to the number of ticks the timer interrupt does in a second. For example, the jiffies variable is incremented HZ times per second. Also, much OS functions take timeout parameters measured in timer ticks; thus the HZ define can be taken as time base: HZ = 1 second, 10*HZ = 10s, HZ/10 = 100ms, etc. |
|
|
This macro is used to test if a specified time has expired. It handles timer variable wrap arounds correctly. The macro is used in conjunction with the jiffies variable, the current jiffies should be passed as first parameter to the macro. Example: |
|
|
Timer function. Allocates a timer object. After a timer is allocated with this function, it must be set up with posTimerSet and than started with posTimerStart.
|
|
|
Timer function. Deletes a timer object and free its resources.
|
|
|
Timer function. The function is used to test if a timer has fired.
|
|
||||||||||||||||||||
|
Timer function. Sets up a timer object.
|
|
|
Timer function. Starts a timer. The timer will fire first time when the waitticks counter has been reached zero. If the periodticks were set, the timer will be reloaded with this value.
|
|
|
Timer function. Stops a timer. The timer will no more fire. The timer can be reenabled with posTimerStart.
|
|
|
Global timer variable. The jiffies counter variable is incremented HZ times per second. The maximum count the jiffie counter can reach until it wraps around is system dependent.
|
1.4.6-NO