a simple example of a multitasking system for ARM Cortex-M3 made in Zig for SMT32F103
Zig: v0.14.0
This example contains:
-
context switching between tasks using PendSV
-
a basic syscall with SVCall
multitask functions:
create_task
: creates a task and adds it to the task poolyield
: switch to next tasktask_sleep
: suspends the current task for a period of timeexit
: removes the current task from the task poolsuspend_task
: suspends a current task until it is resumed by another taskresume_task
: resume a suspended task