Typedefs | |
typedef implementation_defined | os_timer_t |
typedef void(* | os_timer_func_t )(void *arg) |
Functions | |
void | os_timer_init (os_timer_t *timer, os_timer_func_t func, void *arg) |
void | os_timer_set (os_timer_t *timer, unsigned long expires_ms) |
void | os_timer_cancel (os_timer_t *timer) |
typedef void(* os_timer_func_t)(void *arg) |
Timer expiry function.
The function called when a timer expires must be of this type.
arg | the argument supplied when the timer was initialized. |
typedef implementation_defined os_timer_t |
Implementation defined timer object.
void os_timer_cancel | ( | os_timer_t * | timer | ) |
Cancel a timer.
This cancels a timer that was previously started. If the timer has already expired this has no effect.
Callable from: any context.
timer | the timer to stop. |
void os_timer_init | ( | os_timer_t * | timer, | |
os_timer_func_t | func, | |||
void * | arg | |||
) |
Initialize a timer object.
Callable from: thread context.
timer | the timer to initialize. | |
func | the function to call when the timer expires. | |
arg | the argument to pass to func. |
void os_timer_set | ( | os_timer_t * | timer, | |
unsigned long | expires_ms | |||
) |
Set a timer's expiry time.
This sets the time at which the timer will expire. If the timer is already set (but not expired) it is cancelled and reset with the new time. If the timer has expired, the timer is reset.
Callable from: any context.
timer | the timer to start. | |
expires_ms | elapsed time (in milliseconds) until the timer expires. |