Firmware SDK
bc_scheduler

Task scheduler. More...

Macros

#define BC_SCHEDULER_MAX_TASKS   32
 Maximum number of tasks.
 
#define BC_SCHEDULER_INTERVAL_MS   10
 

Typedefs

typedef size_t bc_scheduler_task_id_t
 Task ID assigned by scheduler.
 

Functions

void bc_scheduler_init (void)
 Initialize task scheduler.
 
void bc_scheduler_run (void)
 Run task scheduler (this call never ends)
 
bc_scheduler_task_id_t bc_scheduler_register (void(*task)(void *), void *param, bc_tick_t tick)
 Register task in scheduler. More...
 
void bc_scheduler_unregister (bc_scheduler_task_id_t task_id)
 Unregister specified task. More...
 
bc_scheduler_task_id_t bc_scheduler_get_current_task_id (void)
 Get task ID of currently executing task. More...
 
bc_tick_t bc_scheduler_get_spin_tick (void)
 Get current tick of spin in which task has been run. More...
 
void bc_scheduler_disable_sleep (void)
 Disable sleep mode, implemented as semaphore.
 
void bc_scheduler_enable_sleep (void)
 Enable sleep mode, implemented as semaphore.
 
void bc_scheduler_plan_now (bc_scheduler_task_id_t task_id)
 Schedule specified task for immediate execution. More...
 
void bc_scheduler_plan_absolute (bc_scheduler_task_id_t task_id, bc_tick_t tick)
 Schedule specified task to absolute tick. More...
 
void bc_scheduler_plan_relative (bc_scheduler_task_id_t task_id, bc_tick_t tick)
 Schedule specified task to tick relative from current spin. More...
 
void bc_scheduler_plan_from_now (bc_scheduler_task_id_t task_id, bc_tick_t tick)
 Schedule specified task to tick relative from now. More...
 
void bc_scheduler_plan_current_now (void)
 Schedule current task for immediate execution.
 
void bc_scheduler_plan_current_absolute (bc_tick_t tick)
 Schedule current task to absolute tick. More...
 
void bc_scheduler_plan_current_relative (bc_tick_t tick)
 Schedule current task to tick relative from current spin. More...
 
void bc_scheduler_plan_current_from_now (bc_tick_t tick)
 Schedule current task to tick relative from now. More...
 

Detailed Description

Task scheduler.

Function Documentation

◆ bc_scheduler_get_current_task_id()

bc_scheduler_task_id_t bc_scheduler_get_current_task_id ( void  )

Get task ID of currently executing task.

Returns
Task ID

Definition at line 99 of file bc_scheduler.c.

◆ bc_scheduler_get_spin_tick()

bc_tick_t bc_scheduler_get_spin_tick ( void  )

Get current tick of spin in which task has been run.

Returns
Tick of spin

Definition at line 104 of file bc_scheduler.c.

Referenced by bc_button_set_hold_time(), bc_module_relay_init(), bc_sgp30_set_compensation(), bc_sgpc3_set_compensation(), and bc_switch_set_pull_advance_time().

Here is the caller graph for this function:

◆ bc_scheduler_plan_absolute()

◆ bc_scheduler_plan_current_absolute()

◆ bc_scheduler_plan_current_from_now()

◆ bc_scheduler_plan_current_relative()

◆ bc_scheduler_plan_from_now()

void bc_scheduler_plan_from_now ( bc_scheduler_task_id_t  task_id,
bc_tick_t  tick 
)

Schedule specified task to tick relative from now.

Parameters
[in]task_idTask ID to be scheduled
[in]tickTick at which the task will be run as a relative value from now

Definition at line 134 of file bc_scheduler.c.

Referenced by bc_led_pulse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bc_scheduler_plan_now()

◆ bc_scheduler_plan_relative()

◆ bc_scheduler_register()

◆ bc_scheduler_unregister()