O'Reilly logo

The Definitive Guide to ARM® Cortex®-M0 and Cortex-M0+ Processors, 2nd Edition by Joseph Yiu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required