STM32H750XB_Hello/Core/Src/user_tasks.c

26 lines
886 B
C
Raw Normal View History

2021-03-01 16:46:18 +00:00
#include "lvgl.h"
2021-03-03 15:52:47 +00:00
#include "main.h"
2021-03-02 17:33:59 +00:00
#include "user_tasks.h"
void user_tasks_init(void) {
g_user_sysview_task_handle = osThreadNew(user_sysview_task, NULL, &g_user_sysview_task_attributes);
if(g_user_sysview_task_handle == NULL) Error_Handler();
2021-03-03 15:52:47 +00:00
// 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.
2021-03-04 15:58:50 +00:00
osEventFlagsWait(g_user_lvgl_event_handle, USER_LVGL_EVENT_FLAG_READY, osFlagsNoClear, osWaitForever);
2021-03-01 16:46:18 +00:00
2021-03-02 17:33:59 +00:00
g_user_hello_task_handle = osThreadNew(user_hello_task, NULL, &g_user_hello_task_attributes);
2021-03-03 15:52:47 +00:00
if(g_user_hello_task_handle == NULL) Error_Handler();
}