56 #define SCHEDULER_TIMEBASE 1000000
59 typedef uint8_t task_handle_t;
76 typedef void* task_argument_t;
82 typedef task_return_t (*task_function_t)(task_argument_t);
103 } task_timing_mode_t;
126 } schedule_strategy_t;
215 bool scheduler_add_task(
scheduler_t* scheduler, uint32_t repeat_period, task_run_mode_t run_mode, task_timing_mode_t timing_mode, task_priority_t priority, task_function_t call_function, task_argument_t function_argument, uint32_t task_id);
264 void scheduler_change_run_mode(
task_entry_t *te, task_run_mode_t new_run_mode);
273 void scheduler_change_task_period(
task_entry_t *te, uint32_t repeat_period);
282 void scheduler_suspend_task(
task_entry_t *te, uint32_t delay);
uint32_t delay_avg
Average delay between expected execution and actual execution.
Definition: scheduler.h:144
task_run_mode_t run_mode
Run mode.
Definition: scheduler.h:137
task_argument_t function_argument
Argument to be passed to the function.
Definition: scheduler.h:135
uint32_t max_task_count
Maximum number of tasks.
Definition: scheduler.h:184
uint32_t next_run
Next execution time.
Definition: scheduler.h:141
uint32_t task_id
Unique task identifier.
Definition: scheduler.h:136
task_priority_t priority
Priority.
Definition: scheduler.h:139
Scheduler.
Definition: scheduler.h:171
task_set_t * task_set
Pointer to task set, needs memory allocation.
Definition: scheduler.h:175
bool debug
Indicates whether the scheduler should print debug messages.
Definition: scheduler.h:186
schedule_strategy_t schedule_strategy
Scheduling strategy.
Definition: scheduler.h:174
uint32_t max_task_count
Maximum number of tasks.
Definition: scheduler.h:159
task_timing_mode_t timing_mode
Timing mode.
Definition: scheduler.h:138
uint32_t task_count
Number_of_tasks.
Definition: scheduler.h:158
Scheduler configuration.
Definition: scheduler.h:182
Task entry.
Definition: scheduler.h:132
task_function_t call_function
Function to be called.
Definition: scheduler.h:134
uint32_t rt_violations
Number of Real-time violations, this is incremented each time an execution is skipped.
Definition: scheduler.h:146
schedule_strategy_t schedule_strategy
Schedule strategy.
Definition: scheduler.h:185
uint32_t current_schedule_slot
Slot of the task being executed.
Definition: scheduler.h:160
Task set.
Definition: scheduler.h:156
uint32_t delay_var_squared
Standard deviation of the delay.
Definition: scheduler.h:145
uint32_t delay_max
Maximum delay between expected execution and actual execution.
Definition: scheduler.h:143
uint32_t execution_time
Execution time.
Definition: scheduler.h:142
bool debug
Indicates whether the scheduler should print debug messages.
Definition: scheduler.h:173
task_entry_t tasks[]
Array of tasks_entry to be executed, needs memory allocation.
Definition: scheduler.h:161
uint32_t repeat_period
Period between two calls (us)
Definition: scheduler.h:140