1 #ifndef _SCHEDULER_H_ 2 #define _SCHEDULER_H_ 3 4 #ifdef __cplusplus 5 extern "C" { 6 #endif 7 8 #include <stdint.h> 9 10 typedef struct { 11 void (*on_update)(void); 12 uint16_t period; 13 uint8_t id; 14 uint16_t ticks; 15 } task_t; 16 17 void scheduler_init(task_t *tasks, uint8_t task_count); 18 void scheduler_update(void); 19 void scheduler_tick(void); 20 void scheduler_set_task_period(uint8_t task_id, uint16_t new_period); 21 22 #ifdef __cplusplus 23 } 24 #endif 25 26 #endif // _SCHEDULER_H_
