LVGL 库提交

This commit is contained in:
2026-08-30 08:57:07 +08:00
parent 26c9098630
commit e2f199c6bf
1056 changed files with 556743 additions and 45 deletions
+42
View File
@@ -0,0 +1,42 @@
/**
* @file ui_task.c
* @brief UI 主任务:等待网络就绪 -> 初始化显示/菜单/推流 -> 周期刷新
* @note 单任务内同时驱动 LVGL 刷新与网络推流轮询,避免任一方阻塞导致界面不刷新。
*/
#include "ui_task.h"
#include "cmsis_os.h"
#include "sys_events.h"
#include "ui_port.h"
#include "ui_menu.h"
#include "ui_net_sink.h"
static void ui_task_wait_net_ready(void)
{
if (sys_evtHandle != NULL) {
osEventFlagsWait(sys_evtHandle, SYS_EVT_NET_READY,
osFlagsWaitAny, osWaitForever);
}
}
void ui_task_func(void *argument)
{
(void)argument;
ui_task_wait_net_ready();
if (ui_port_init() != 0) {
for (;;) { osDelay(1000); }
}
if (ui_menu_init() != 0) {
for (;;) { osDelay(1000); }
}
ui_net_sink_start(UI_NET_SINK_PORT);
while (1) {
ui_port_step(10);
ui_net_sink_poll();
osDelay(10);
}
}
+32
View File
@@ -0,0 +1,32 @@
/*
* 模块名称:UI Task (UI 主任务)
* 模块功能:UI 主任务,协调显示端口、菜单与网络推流的启动与周期运行
* 适用平台:STM32F407ZGTx + FreeRTOS
* 作者:王建锋
* 创建日期:2026-08-29
* 修改记录:
* 2026-08-29 王建锋 创建初始版本
*/
#ifndef __UI_TASK_H
#define __UI_TASK_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* 函数功能:UI 主任务入口
* 入口参数:argument - FreeRTOS 传入参数(未使用) void * 可空
* 返回值:无(任务不返回)
* 限定条件:FreeRTOS 已启动,SYS_EVT_NET_READY 事件最终会被置位
* 函数说明:1. 等待网络就绪事件后初始化显示端口与菜单
* 2. 启动 UI 网络推流监听,并周期刷新 LVGL 与轮询推流
* 3. 循环内同时驱动界面刷新与网络,避免任一方阻塞
*/
void ui_task_func(void *argument);
#ifdef __cplusplus
}
#endif
#endif /* __UI_TASK_H */