From 421c5903fc84c7ab7b7796b63397f0e7cc7c8967 Mon Sep 17 00:00:00 2001 From: SnickerSun Date: Thu, 5 Sep 2024 15:34:59 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8Dbutton=20release=E5=8F=AF?= =?utf8?q?=E8=83=BD=E4=B8=8D=E4=B8=8A=E6=8A=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- code/sdk/drivers/peripheral/button/button.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/sdk/drivers/peripheral/button/button.c b/code/sdk/drivers/peripheral/button/button.c index 2a65e79c6..e038cd5c6 100644 --- a/code/sdk/drivers/peripheral/button/button.c +++ b/code/sdk/drivers/peripheral/button/button.c @@ -55,6 +55,7 @@ timer_handle_t g_button_timer = {0}; timer_handle_t g_gpio_button_timer = {0}; button_info_t g_button_info = {0}; bool g_timer_is_running = false; +bool g_button_timer_is_running = false; msg_send_callback_t g_msg_send_cb = NULL; static const char* g_state_str[PRESSED_MAX] = { @@ -121,8 +122,8 @@ static void button_timer_start(void) static void button_timer_start_check_released(void) { bool start = false; - if (!g_timer_is_running) { - g_timer_is_running = true; + if (!g_button_timer_is_running) { + g_button_timer_is_running = true; start = true; } @@ -235,7 +236,7 @@ static void button_check_released_timer_callback(uint32_t data) { unused(data); - g_timer_is_running = false; + g_button_timer_is_running = false; button_peripheral_api *button_api = button_port_get_api(); button_press_state_t press_state; -- 2.17.1