#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <types.h>
#include <timer.h>
Go to the source code of this file.
◆ TIMER_ALWAYS_RUN
| #define TIMER_ALWAYS_RUN 0xFFFFFFFF |
◆ task_t
◆ timer_t
◆ timer_create()
| void timer_create |
( |
timer_t * |
timer, |
|
|
void(*)(void *arg, uint32_t event) |
callback, |
|
|
void * |
arg |
|
) |
| |
Create a timer.
- Parameters
-
| timer | A pointer to a timer_t object to save the newly created timer. |
| callback | A pointer to the function that will be called when the timer times out. |
| arg | A void pointer used to pass arguments to the callback function. |
◆ timer_handle()
Timer processing function, needs to be called continuously in the main loop to achieve normal operation of the timer.
◆ timer_start()
Start a timer.
- Parameters
-
| timer | A pointer to an already created timer_t object. |
| max_run_count | The maximum number of times the timer will run. 0 means it will run indefinitely. |
| interval | The time interval of the timer. |