添加切换模式提示效果
This commit is contained in:
@@ -120,6 +120,12 @@ static void button_scan(button_t *btn) {
|
|||||||
|
|
||||||
case 3: // 第二次按下状态
|
case 3: // 第二次按下状态
|
||||||
btn->tick_cnt++;
|
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) {
|
if (!btn->stable_state) {
|
||||||
// 第二次松开 -> 双击
|
// 第二次松开 -> 双击
|
||||||
btn->callback(EVT_PRESS_UP);
|
btn->callback(EVT_PRESS_UP);
|
||||||
@@ -132,6 +138,7 @@ static void button_scan(button_t *btn) {
|
|||||||
btn->click_count = 0;
|
btn->click_count = 0;
|
||||||
btn->state = 0;
|
btn->state = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include "sys_log.h"
|
#include "sys_log.h"
|
||||||
#include "os/os.h"
|
#include "os/os.h"
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
|
#include "../led_strip/led_strip.h"
|
||||||
// 按键事件类型
|
// 按键事件类型
|
||||||
typedef enum {
|
typedef enum {
|
||||||
EVT_NONE = 0, // 无事件
|
EVT_NONE = 0, // 无事件
|
||||||
|
|||||||
Reference in New Issue
Block a user