Switching between multiple tasks, Part 2 [STM32 and FreeRTOS]
This is a sample program that combines task switching and USART communication, and manages task execution and suspension based on whether or not the command code given externally matches.
This is a program that sets command codes for task switching in advance and executes the task specified by the command code and stops other tasks when the externally given code matches.
This time, instead of using an input switch, a command is used to switch between Task A and Task B. The command string "TaskA@" switches to Task A, and "TaskB@" switches to Task B, which is displayed on the screen.
The '@' at the end of the command is to recognize the end of the input string. Instead of '@', an enter key (CR) input can be used as the end of the string, in which case the ASCII code is 0x0D.