To access the GLCD using mutual exclusion, follow the steps outlined:
Create a new project and using the manager configure the RTE to provide support for the Graphic LCD.
Create a new file named
RTXBlinky.c
, add the boilerplate code, and then add this source file to the project.Add the following code to
RTXBlinky.c
:#include "stm32f4xx_hal.h" /* STM32F4xx Defs */ #include "RTXBlinkyUtils.h" #include "cmsis_os.h" osThreadId tid_taskA; /* id of thread: task_a */ osThreadId tid_taskB; /* id of thread: task_b */ osMutexId mut_GLCD; /* Mutex to control GLCD access */ /*-------------------------------------------------- * Switch LED on *--------------------------------------------------*/ void switch_On (unsigned char led) { osMutexWait(mut_GLCD, osWaitForever); GLCD_SetBackgroundColor (GLCD_COLOR_WHITE); GLCD_SetForegroundColor(GLCD_COLOR_RED); GLCD_SetFont (&GLCD_Font_16x24); GLCD_DrawChar(led+(7...