- include "sched.h"
- Create a scheduler and one or more tasks
- Start the scheduler
- Call the scheduler's loop() function as the only content of your main loop function
- (optional) typedef NOW_T - a unitless measure of time. defaults to long long
- You must define two functions: ** void SLEEP(NOW_T time) -- takes the number of time units to sleep ** NOW_T NOW() -- returns a NOW_T representing the current time
Sched is time-unit-agnostic, as long as your SLEEP and NOW functions share a timebase. The maximum interval is limited by the number of bits in your NOW_T and time-per-bit of your NOW() function.
- Periodic execution of tasks
- Run each task once, a set number of times, or forever
- Runtime metrics per scheduler and per task
- Dynamically add/delete tasks
- Dynamically deactivate/reactivate tasks
- Reference tasks by pointer, taskID, or pointer to callback function
- Anonymous callback functions
- Multiple instances of each task using context structs
- Dynamically modify tasks including intervals, remaining iterations, and callbacks