feat(led): 添加LED按键淡入淡出效果并重构LED条模块

添加了完整的LED效果系统架构,包括:
- 新增主题颜色定义文件theme_color.h
- 实现key fade LED效果算法,支持按键触发的渐变效果
- 创建LED效果注册机制和通用接口
- 配置17个LED像素与按键映射关系
- 将原有简单的周期性效果替换为基于按键事件的动态效果

CMakeLists.txt中添加了新的源文件路径和实现文件。

BREAKING CHANGE: LED效果从固定的周期性变化改为响应按键事件的动态效果。
This commit is contained in:
2026-04-13 15:56:45 +08:00
parent ff8f0d81d7
commit 23e23f63a7
8 changed files with 407 additions and 55 deletions

View File

@@ -16,6 +16,7 @@
#include "bat_state_event.h"
#include "hid_led_event.h"
#include "mode_switch_event.h"
#include "theme_color.h"
#include "ui/ui_main.h"
LOG_MODULE_REGISTER(MODULE, LOG_LEVEL_INF);
@@ -30,7 +31,9 @@ static const struct device *const backlight_dev =
DEVICE_DT_GET(DT_PARENT(DT_ALIAS(backlight)));
static const uint32_t backlight_idx = DT_NODE_CHILD_IDX(DT_ALIAS(backlight));
static struct ui_main_model ui_model = {
.theme_color = LV_COLOR_MAKE(0x4C, 0x9E, 0xF5),
.theme_color = LV_COLOR_MAKE(BLINKY_THEME_DEFAULT_R,
BLINKY_THEME_DEFAULT_G,
BLINKY_THEME_DEFAULT_B),
.inactive_border_color = LV_COLOR_MAKE(0x3A, 0x44, 0x52),
.mode = MODE_SWITCH_BLE,
};