Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_scheduler

Task scheduler. More...

Macros

#define BC_SCHEDULER_MAX_TASKS   32
 Maximum number of tasks.
 

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_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_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.

void bc_scheduler_plan_current_absolute ( bc_tick_t  tick)

Schedule current task to absolute tick.

Parameters
[in]tickTick at which the task will be run

Definition at line 144 of file bc_scheduler.c.

void bc_scheduler_plan_current_from_now ( bc_tick_t  tick)

Schedule current task to tick relative from now.

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

Definition at line 154 of file bc_scheduler.c.

Here is the call graph for this function:

void bc_scheduler_plan_current_relative ( bc_tick_t  tick)

Schedule current task to tick relative from current spin.

Parameters
[in]tickTick at which the task will be run as a relative value from current spin

Definition at line 149 of file bc_scheduler.c.

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:

void bc_scheduler_unregister ( bc_scheduler_task_id_t  task_id)

Unregister specified task.

Parameters
[in]task_idTask ID to be unregistered

Definition at line 80 of file bc_scheduler.c.

Referenced by bc_atci_set_uart_active_callback(), bc_eeprom_async_cancel(), bc_module_encoder_deinit(), bc_module_rs485_async_read_stop(), bc_spirit1_deinit(), bc_tmp112_deinit(), bc_uart_async_read_cancel(), and bc_zssc3123_deinit().

Here is the caller graph for this function: