- 新增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添加可见性控制函数用于界面切换
30 lines
834 B
C
30 lines
834 B
C
#include "settings_mode_event.h"
|
|
|
|
static void log_settings_mode_event(const struct app_event_header *aeh)
|
|
{
|
|
const struct settings_mode_event *event =
|
|
cast_settings_mode_event(aeh);
|
|
|
|
APP_EVENT_MANAGER_LOG(aeh, "active:%u", event->active);
|
|
}
|
|
|
|
static void profile_settings_mode_event(struct log_event_buf *buf,
|
|
const struct app_event_header *aeh)
|
|
{
|
|
const struct settings_mode_event *event =
|
|
cast_settings_mode_event(aeh);
|
|
|
|
nrf_profiler_log_encode_uint8(buf, event->active ? 1U : 0U);
|
|
}
|
|
|
|
APP_EVENT_INFO_DEFINE(settings_mode_event,
|
|
ENCODE(NRF_PROFILER_ARG_U8),
|
|
ENCODE("active"),
|
|
profile_settings_mode_event);
|
|
|
|
APP_EVENT_TYPE_DEFINE(settings_mode_event,
|
|
log_settings_mode_event,
|
|
&settings_mode_event_info,
|
|
APP_EVENT_FLAGS_CREATE(
|
|
APP_EVENT_TYPE_FLAGS_INIT_LOG_ENABLE));
|