STM32H750XB_Hello/Core/Src/user_tasks.c

22 lines
708 B
C

#include "lvgl.h"
#include "main.h"
#include "user_tasks.h"
void user_tasks_init(void) {
// Create LVGL event flag.
g_user_lvgl_event_handle = osEventFlagsNew(NULL);
if(g_user_lvgl_event_handle == NULL) {
osThreadExit();
}
g_user_lvgl_task_handle = osThreadNew(user_lvgl_task, NULL, &g_user_lvgl_task_attributes);
if(g_user_lvgl_task_handle == NULL) Error_Handler();
// Wait here to make sure LVGL is initialized.
osEventFlagsWait(g_user_lvgl_event_handle, USER_LVGL_EVENT_FLAG_READY, 0U, osWaitForever);
g_user_hello_task_handle = osThreadNew(user_hello_task, NULL, &g_user_hello_task_attributes);
if(g_user_hello_task_handle == NULL) Error_Handler();
}