This is an implementation for a non-preemptive scheduler on ARM STM32F103xx microcontroller
-
This scheduler is implemented using SysTick and RCC drivers in my drivers repo
So, they should be included in the project. Also, STD_TYPES.h must be included. -
You can include SCHED.h in any other module, create a task as follows:
Task t1 = { .runnable = function, .periodicTimeMS = PERIOD_IN_MS, .priority = PRIORITY };
Note that PRIORITY should be a number between (0) and (SCHED_MAX_TASK_NUM - 1).
-
The created task should be included in SCHED_CFG.c
-
SCHED_CFG.h should be edited with proper clock configurations & proper task count.