From 92da547b370a4af47cfe17d902e83cb394ff1484 Mon Sep 17 00:00:00 2001 From: ChenYangFeng Date: Mon, 15 Aug 2022 10:35:31 +0800 Subject: [PATCH] Add LONG_PRESS_CLICK --- multi_button.c | 4 ++-- multi_button.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/multi_button.c b/multi_button.c index 1061e68..9dc8f0e 100644 --- a/multi_button.c +++ b/multi_button.c @@ -143,8 +143,8 @@ void button_handler(struct Button* handle) EVENT_CB(LONG_PRESS_HOLD); } else { //releasd - handle->event = (uint8_t)PRESS_UP; - EVENT_CB(PRESS_UP); + handle->event = (uint8_t)LONG_PRESS_CLICK; + EVENT_CB(LONG_PRESS_CLICK); handle->state = 0; //reset } break; diff --git a/multi_button.h b/multi_button.h index b066ade..de100a8 100644 --- a/multi_button.h +++ b/multi_button.h @@ -26,6 +26,7 @@ typedef enum { DOUBLE_CLICK, LONG_PRESS_START, LONG_PRESS_HOLD, + LONG_PRESS_CLICK, number_of_event, NONE_PRESS }PressEvent;