feat: 添加设置模块和相关UI功能

- 新增settings_module.c实现设置菜单逻辑,包括蓝牙配对槽位管理和主题颜色选择
- 添加settings_mode_event.h/.c和settings_view_event.h/.c事件定义用于设置模式切换
- 创建settings_ui.h定义设置界面状态结构体和页面枚举
- 修改display_module.c集成设置UI显示逻辑,支持主界面和设置界面切换
- 在keyboard_core_module.c中添加设置活动状态检查,避免设置模式下键盘输入冲突
- 更新CMakeLists.txt包含新的源文件:settings_module.c、ui_settings.c及新事件文件
- 修改prj.conf调整LVGL内存池大小从16KB到32KB以支持更复杂UI渲染
- 移除BLE配对擦除相关配置选项并增加长按检测时间到1500毫秒
- 更新ui_main.c添加可见性控制函数用于界面切换
This commit is contained in:
2026-04-23 15:12:29 +08:00
parent 6a03df1b39
commit fbdc5426be
14 changed files with 1181 additions and 8 deletions

View File

@@ -0,0 +1,30 @@
#ifndef BLINKY_SETTINGS_MODE_EVENT_H_
#define BLINKY_SETTINGS_MODE_EVENT_H_
#include <app_event_manager.h>
#include <app_event_manager_profiler_tracer.h>
#ifdef __cplusplus
extern "C" {
#endif
struct settings_mode_event {
struct app_event_header header;
bool active;
};
APP_EVENT_TYPE_DECLARE(settings_mode_event);
static inline void submit_settings_mode_event(bool active)
{
struct settings_mode_event *event = new_settings_mode_event();
event->active = active;
APP_EVENT_SUBMIT(event);
}
#ifdef __cplusplus
}
#endif
#endif /* BLINKY_SETTINGS_MODE_EVENT_H_ */

View File

@@ -0,0 +1,40 @@
#ifndef BLINKY_SETTINGS_VIEW_EVENT_H_
#define BLINKY_SETTINGS_VIEW_EVENT_H_
#include <string.h>
#include <app_event_manager.h>
#include <app_event_manager_profiler_tracer.h>
#include "settings_ui.h"
#ifdef __cplusplus
extern "C" {
#endif
struct settings_view_event {
struct app_event_header header;
struct settings_ui_state state;
};
APP_EVENT_TYPE_DECLARE(settings_view_event);
static inline void submit_settings_view_event(
const struct settings_ui_state *state)
{
struct settings_view_event *event;
if (state == NULL) {
return;
}
event = new_settings_view_event();
memcpy(&event->state, state, sizeof(event->state));
APP_EVENT_SUBMIT(event);
}
#ifdef __cplusplus
}
#endif
#endif /* BLINKY_SETTINGS_VIEW_EVENT_H_ */