If the underlying timer source is aperiodic, we need to reprogram the next shot after each tick at hardware level, and we cannot count on a strictly periodic source. In such a case, the timer manager only uses a single slot (#0) from the wheel as a plain linked list, which is ordered by increasing timeout values of the running timers.
Depending on the above mode, the timer object stores time values either as count of periodic ticks, or as count of CPU ticks.
Files | |
file | timer.c |
Functions | |
void | xntimer_init (xntimer_t *timer, void(*handler)(void *cookie), void *cookie) |
Initialize a timer object. | |
void | xntimer_destroy (xntimer_t *timer) |
Release a timer object. | |
int | xntimer_start (xntimer_t *timer, xnticks_t value, xnticks_t interval) |
Arm a timer. | |
void | xntimer_stop (xntimer_t *timer) |
Disarm a timer. | |
xnticks_t | xntimer_get_date (xntimer_t *timer) |
Return the absolute expiration date. | |
xnticks_t | xntimer_get_timeout (xntimer_t *timer) |
Return the relative expiration date. | |
void | xntimer_do_timers (void) |
Process a timer tick. | |
void | xntimer_freeze (void) |
Freeze all timers. |
|
Release a timer object. Destroys a timer. After it has been destroyed, all resources associated with the timer have been released. The timer is automatically deactivated before deletion if active on entry.
This service can be called from:
Rescheduling: never. |
|
Process a timer tick.
For internal use only. This routine informs all active timers that the clock has been updated by processing the timer wheel. Elapsed timer actions will be fired. Environments: This service can be called from:
Rescheduling: never.
|
|
Freeze all timers.
For internal use only. This routine deactivates all active timers atomically. Environments: This service can be called from:
Rescheduling: never.
|
|
Return the absolute expiration date. Return the next expiration date of a timer in absolute clock ticks (see note).
This service can be called from:
Rescheduling: never.
|
|
Return the relative expiration date. Return the next expiration date of a timer in relative clock ticks (see note).
This service can be called from:
Rescheduling: never.
|
|
Initialize a timer object. Creates a timer. When created, a timer is left disarmed; it must be started using xntimer_start() in order to be activated.
Environments: This service can be called from:
Rescheduling: never. |
|
Arm a timer. Activates a timer so that the associated timeout handler will be fired after each expiration time. A timer can be either periodic or single-shot, depending on the reload value passed to this routine. The given timer must have been previously initialized by a call to xntimer_init().
This service can be called from:
Rescheduling: never.
|
|
Disarm a timer. This service deactivates a timer previously armed using xntimer_start(). Once disarmed, the timer can be subsequently re-armed using the latter service.
This service can be called from:
Rescheduling: never. |