1 #ifndef _TWR_SCHEDULER_H
2 #define _TWR_SCHEDULER_H
12 #ifndef TWR_SCHEDULER_MAX_TASKS
13 #define TWR_SCHEDULER_MAX_TASKS 32
16 #ifndef TWR_SCHEDULER_INTERVAL_MS
17 #define TWR_SCHEDULER_INTERVAL_MS 10
void twr_scheduler_run(void)
Run task scheduler (this call never ends)
void twr_scheduler_plan_current_from_now(twr_tick_t tick)
Schedule current task to tick relative from now.
void twr_scheduler_plan_current_relative(twr_tick_t tick)
Schedule current task to tick relative from current spin.
void twr_scheduler_plan_current_absolute(twr_tick_t tick)
Schedule current task to absolute tick.
void twr_scheduler_plan_absolute(twr_scheduler_task_id_t task_id, twr_tick_t tick)
Schedule specified task to absolute tick.
void twr_scheduler_init(void)
Initialize task scheduler.
void twr_scheduler_enable_sleep(void)
Enable sleep mode, implemented as semaphore.
void twr_scheduler_disable_sleep(void)
Disable sleep mode, implemented as semaphore.
void twr_scheduler_unregister(twr_scheduler_task_id_t task_id)
Unregister specified task.
void twr_scheduler_plan_from_now(twr_scheduler_task_id_t task_id, twr_tick_t tick)
Schedule specified task to tick relative from now.
size_t twr_scheduler_task_id_t
Task ID assigned by scheduler.
void twr_scheduler_plan_now(twr_scheduler_task_id_t task_id)
Schedule specified task for immediate execution.
void twr_scheduler_plan_current_now(void)
Schedule current task for immediate execution.
twr_tick_t twr_scheduler_get_spin_tick(void)
Get current tick of spin in which task has been run.
void twr_scheduler_plan_relative(twr_scheduler_task_id_t task_id, twr_tick_t tick)
Schedule specified task to tick relative from current spin.
twr_scheduler_task_id_t twr_scheduler_get_current_task_id(void)
Get task ID of currently executing task.
twr_scheduler_task_id_t twr_scheduler_register(void(*task)(void *), void *param, twr_tick_t tick)
Register task in scheduler.
uint64_t twr_tick_t
Timestamp data type.