feat: 增强用户界面组件与功能
- 在 CMakeLists.txt 中添加新的源文件和依赖项以支持 UI 组件 - 新增 ui.c、ui_helpers.c、ui_events.h、ui.h、screens/ui_Screen1.c 和相关头文件,构建用户界面 - 更新 main.c 以初始化 UI 组件并调整 LVGL 任务栈大小 - 引入新的屏幕和控件,提升用户交互体验 - 添加 project.info 文件以记录项目元数据
This commit is contained in:
+8
-4
@@ -34,6 +34,8 @@
|
||||
#include "lwip/err.h"
|
||||
#include "lwip/sys.h"
|
||||
|
||||
#include "ui.h"
|
||||
|
||||
/* The examples use WiFi configuration that you can set via project
|
||||
configuration menu
|
||||
|
||||
@@ -129,7 +131,8 @@
|
||||
#define EXAMPLE_LVGL_TICK_PERIOD_MS 2
|
||||
#define EXAMPLE_LVGL_TASK_MAX_DELAY_MS 500
|
||||
#define EXAMPLE_LVGL_TASK_MIN_DELAY_MS 1000 / CONFIG_FREERTOS_HZ
|
||||
#define EXAMPLE_LVGL_TASK_STACK_SIZE (4 * 1024)
|
||||
// 8KB stack size for LVGL task
|
||||
#define EXAMPLE_LVGL_TASK_STACK_SIZE (8 * 1024)
|
||||
#define EXAMPLE_LVGL_TASK_PRIORITY 2
|
||||
|
||||
// 开启触摸屏支持
|
||||
@@ -197,7 +200,7 @@ static const char *TAG = "example";
|
||||
|
||||
static int s_retry_num = 0;
|
||||
|
||||
extern void example_lvgl_demo_ui(lv_disp_t *disp);
|
||||
// extern void example_lvgl_demo_ui(lv_disp_t *disp);
|
||||
|
||||
/**
|
||||
* @brief 设置 LCD 背光亮度
|
||||
@@ -544,10 +547,11 @@ void app_main(void) {
|
||||
xTaskCreate(example_lvgl_port_task, "LVGL", EXAMPLE_LVGL_TASK_STACK_SIZE,
|
||||
NULL, EXAMPLE_LVGL_TASK_PRIORITY, NULL);
|
||||
|
||||
ESP_LOGI(TAG, "Display LVGL Meter Widget");
|
||||
ESP_LOGI(TAG, "Lock the mutex due to the LVGL APIs are not thread-safe");
|
||||
// Lock the mutex due to the LVGL APIs are not thread-safe
|
||||
_lock_acquire(&lvgl_api_lock);
|
||||
example_lvgl_demo_ui(display);
|
||||
// example_lvgl_demo_ui(display);
|
||||
ui_init();
|
||||
_lock_release(&lvgl_api_lock);
|
||||
|
||||
// Initialize NVS
|
||||
|
||||
Reference in New Issue
Block a user