May 2020
Intermediate to advanced
496 pages
13h 54m
English
Here's the updated GreenTaskA() – only a single line has changed. This excerpt has been taken from mainPolledExample.c:
void GreenTaskA( void* argument ){ uint_fast8_t count = 0; while(1) { //every 5 times through the loop, set the flag if(++count >= 5) { count = 0; SEGGER_SYSVIEW_PrintfHost("Task A (green LED) sets flag"); flag = 1; //set 'flag' to 1 to "signal" BlueTaskB to run
Instead of calling xSmeaphoreGive(), we're simply setting the flag variable to 1.
A similar small change has been made to BlueTaskB(), trading out a while loop that polls on flag, instead of using xSemaphoreTake(). This can be seen in the following excerpt from mainPolledExample.c:
void BlueTaskB( void* argument ){ while(1) { SEGGER_SYSVIEW_PrintfHost("Task ...