添加切换模式提示效果

This commit is contained in:
OPTOC
2025-09-02 10:33:03 +08:00
parent 5c37aac938
commit 7960bb80ec
2 changed files with 8 additions and 1 deletions

View File

@@ -120,6 +120,12 @@ static void button_scan(button_t *btn) {
case 3: // 第二次按下状态
btn->tick_cnt++;
// 单击长按后提示
if(btn->tick_cnt > LONG_PRESS_TICKS)
{
rgb_color_change(0, RGB_COLOR_CYAN);
rgb_update_cyle(100);
}
if (!btn->stable_state) {
// 第二次松开 -> 双击
btn->callback(EVT_PRESS_UP);
@@ -132,6 +138,7 @@ static void button_scan(button_t *btn) {
btn->click_count = 0;
btn->state = 0;
}
break;
default:

View File

@@ -10,7 +10,7 @@
#include "sys_log.h"
#include "os/os.h"
#include "device.h"
#include "../led_strip/led_strip.h"
// 按键事件类型
typedef enum {
EVT_NONE = 0, // 无事件