![]() |
SyterKit 0.4.0.x
SyterKit is a bare-metal framework
|
#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include <types.h>#include <timer.h>#include "os.h"
Functions | |
| static void | add_task (task_t *new_task) |
| static void | remove_task (task_t *task) |
| static void | task_loop () |
| void | timer_create (timer_t *timer, void(*callback)(void *arg, uint32_t event), void *arg) |
| Create a timer. | |
| void | timer_start (timer_t *timer, uint32_t max_run_count, uint32_t interval) |
| Start a timer. | |
| void | timer_handle () |
| Timer processing function, needs to be called continuously in the main loop to achieve normal operation of the timer. | |
Variables | |
| static task_t * | task_list = NULL |
|
static |
|
static |
|
static |
Create a timer.
| 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. |
| void timer_handle | ( | ) |
Timer processing function, needs to be called continuously in the main loop to achieve normal operation of the timer.
Start a timer.
| 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. |