The code for the project can be implemented as:
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

Get The Definitive Guide to ARM® Cortex®-M0 and Cortex-M0+ Processors, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.