SyterKit 0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
Functions | Variables
os.c File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <types.h>
#include <timer.h>
#include "os.h"
Include dependency graph for os.c:

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_ttask_list = NULL
 

Function Documentation

◆ add_task()

static void add_task ( task_t new_task)
static

◆ remove_task()

static void remove_task ( task_t task)
static

◆ task_loop()

static void task_loop ( )
static

◆ timer_create()

void timer_create ( timer_t timer,
void(*)(void *arg, uint32_t event)  callback,
void *  arg 
)

Create a timer.

Parameters
timerA pointer to a timer_t object to save the newly created timer.
callbackA pointer to the function that will be called when the timer times out.
argA void pointer used to pass arguments to the callback function.

◆ timer_handle()

void timer_handle ( )

Timer processing function, needs to be called continuously in the main loop to achieve normal operation of the timer.

◆ timer_start()

void timer_start ( timer_t timer,
uint32_t  max_run_count,
uint32_t  interval 
)

Start a timer.

Parameters
timerA pointer to an already created timer_t object.
max_run_countThe maximum number of times the timer will run. 0 means it will run indefinitely.
intervalThe time interval of the timer.

Variable Documentation

◆ task_list

task_t* task_list = NULL
static