Example code for a multi-tasking system with 4 tasks
- LED and UART control code not shown here
#include "stdio.h"
/∗ Macros for word accesses ∗/
#define HW32_REG(ADDRESS) (∗((volatile unsigned long ∗)(ADDRESS)))
void LED_Config(void);
__INLINE static void LED_On (uint32_t led);
__INLINE static void LED_Off (uint32_t led);
// UART functions
extern void UART_config(void);
extern void UART_echo(void);
void task0(void); // Toggle LED0
void task1(void); // Toggle LED1
void task2(void); // Toggle LED2
void task3(void); // UART echo
void Task_Init(uint32_t task_id, uint32_t PC, uint32_t PSP_value, uint32_t Unprivileged);
void __svc(0x00) OS_Init(void); // OS initialization (SVC