Core2 for AWS IoT EduKit BSP 1.5.1
xGuiSemaphore
extern SemaphoreHandle_t xGuiSemaphore;
SemaphoreHandle_t xGuiSemaphore
FreeRTOS semaphore to be used when performing any operation on the display.
Definition: core2forAWS.c:271

FreeRTOS semaphore to be used when performing any operation on the display.

To avoid conflicts with multiple threads attempting to write to the display, take this FreeRTOS semaphore first, use the LVGL widget API of choice, and then give the semaphore. The FreeRTOS task, guiTask(), will write to the ILI9342C display controller to update the display.

Example:

Create a LVGL label widget, set the text of the label to "Hello World!", and align the label to the center of the screen.

xSemaphoreTake(xGuiSemaphore, portMAX_DELAY);
lv_obj_t * hello_label = lv_label_create(NULL, NULL);
lv_label_set_text_static(hello_label, "Hello World!");
lv_obj_align(hello_label, NULL, LV_ALIGN_CENTER, 0, 0);
xSemaphoreGive(xGuiSemaphore);