The Sequencer is a utility that helps schedule tasks in systems without an OS.
The Sequencer utility has been designed as a simple alternative to using a real-time operating system for less complex application cases. However, it does not cover all the services provided by an operating system.
The main features of Sequencer are:
- Task creation: Register a task so the Sequencer can call it.
- Task enable: Mark a task runnable from another task or an interrupt.
- Task pause/resume: Temporarily stop or resume a task from the scheduler’s viewpoint.
- Idle task: Optional hook called when no task is runnable.
The start-up sequence can be split into five steps:
Initialize the Sequencer once with SEQ_Init() after basic hardware setup and before scheduling any tasks
Define tasks as short non-preemptive functions that return quickly, using either single-action tasks (one-shot actions) or state-machine tasks (advance one step per call with internal state).
Register each task with a task ID bit and its callback function using SEQ_RegTask().
To schedule work, set the task bit with a priority index (0 = highest) using SEQ_SetTask().
Call SEQ_Run() inside the infinite loop to let the Sequencer process all pending tasks.