KallistiOS git master
Independent SDK for the Sega Dreamcast
|
Opaque structure describing one one-shot timer. More...
#include <oneshot_timer.h>
Related Symbols | |
(Note that these are not member symbols.) | |
oneshot_timer_t * | oneshot_timer_create (void(*cb)(void *), void *data, unsigned int timeout_ms) |
Create a new one-shot timer. | |
void | oneshot_timer_destroy (oneshot_timer_t *timer) |
Stop and destroy a one-shot timer. | |
void | oneshot_timer_setup (oneshot_timer_t *timer, void(*cb)(void *), void *data, unsigned int timeout_ms) |
Re-configure a one-shot timer. | |
void | oneshot_timer_start (oneshot_timer_t *timer) |
Start a one-shot timer. | |
void | oneshot_timer_stop (oneshot_timer_t *timer) |
Stop a one-shot timer. | |
static void | oneshot_timer_reset (oneshot_timer_t *timer) |
Reset a one-shot timer. | |
Opaque structure describing one one-shot timer.
|
related |
Create a new one-shot timer.
This function will create a one-shot timer using the specified callback, programmed to expire after the given timeout. The timer will be stopped by default and still need to be started using oneshot_timer_start().
cb | The function to call in case the one-shot timer expires. |
data | A parameter to pass to the function called. |
timeout_ms | The timeout value for the one-shot timer, in milliseconds. |
|
related |
Stop and destroy a one-shot timer.
This function will stop the one-shot timer and free its memory.
timer | A pointer to the one-shot timer. |
|
related |
Reset a one-shot timer.
A convenience function to reset the one-shot timer by stopping it then starting it again.
timer | A pointer to the one-shot timer. |
References oneshot_timer_start(), and oneshot_timer_stop().
|
related |
Re-configure a one-shot timer.
This function can be used to change the registered callback or the timeout. Using it on a running timer is unsupported.
timer | A pointer to the one-shot timer. |
cb | The function to call in case the one-shot timer expires. |
data | A parameter to pass to the function called. |
timeout_ms | The timeout value for the one-shot timer, in milliseconds. |
|
related |
Start a one-shot timer.
This function will start the one-shot timer. If not stopped until the timeout value expires, the one-shot timer will call the registered callback function.
timer | A pointer to the one-shot timer. |
|
related |
Stop a one-shot timer.
This function will stop the one-shot timer. If it already expired, this function does nothing. If it did not expire yet, the one-shot timer is stopped and the registered callback won't be called.
timer | A pointer to the one-shot timer. |