This lesson from the Modern Embedded Systems Programming Course covers building a priority-based non-preemptive scheduler within the superloop architecture. Starting from a simple bitmask-based ready set, the scheduler is generalized to support up to 32 tasks via a task registry array. Priority numbering is revised to use intuitive higher-number-equals-higher-priority ordering. The scheduling loop is optimized using the ARM CLZ (count leading zeros) instruction for constant-time task selection. The scheduler is then refactored into a dedicated module (sch.c/sch.h) with a clean API (sch_start, sch_run, sch_post). The lesson also discusses the run-to-completion task model and its constraints, setting the stage for event-driven active objects in the next lesson.

18m watch time
1 Impression