Multitasking by registering multiple tasks [STM32 and FreeRTOS]
This is a sample program to execute two registered tasks simultaneously. Using RTOS, it is easy to execute completely different processes at the same time. As shown in the sample program, the RTOS can be easily executed with a simple description.
Using an RTOS, it is easy to have completely different processes running simultaneously. It would be almost impossible and a waste of time to do the same thing without an RTOS, which, as shown in the sample program, can be done very easily with a simple description.
The program registers two different tasks to perform the two processes, with the first task performing LED blinking every 1000ms and the other task every 500ms.
Without RTOS, the delay_ms function used to be inserted to set the cycle period for processing, but with FreeRTOS, this can be set with the vTaskDelay function. The ability to easily set the task execution cycle is another major advantage of using an RTOS.