diff --git a/app/drivers/sertrf/key.c b/app/drivers/sertrf/key.c index a39cac4..ebadcef 100644 --- a/app/drivers/sertrf/key.c +++ b/app/drivers/sertrf/key.c @@ -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: diff --git a/app/drivers/sertrf/key.h b/app/drivers/sertrf/key.h index 572cb92..5aee184 100644 --- a/app/drivers/sertrf/key.h +++ b/app/drivers/sertrf/key.h @@ -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, // 无事件