From fb0558be7a1633c22561d43d754d6a96e4ec7bc3 Mon Sep 17 00:00:00 2001 From: wangzhengdong Date: Mon, 30 Mar 2020 13:36:51 +0800 Subject: [PATCH] [fix] 1. When more than 1 button registered.For example 5 buttons.The lastest button will received 1 click event when I click the first button. [update] 1. Signed-off-by: wzd5230 <772461552@qq.com> --- flexible_button.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flexible_button.c b/flexible_button.c index 17e8078..8c0fe00 100644 --- a/flexible_button.c +++ b/flexible_button.c @@ -167,7 +167,7 @@ static uint8_t flex_button_process(void) uint8_t active_btn_cnt = 0; flex_button_t* target; - for (target = btn_head, i = 0; target != NULL; target = target->next, i ++) + for (target = btn_head, i = button_cnt - 1; target != NULL; target = target->next, i--) { if (target->status > FLEX_BTN_STAGE_DEFAULT) {