From cf103be82b372a8216c51fbf25f79b28f87b6234 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Sun, 12 Jul 2026 23:25:20 +0200 Subject: [PATCH] Fix FORCE_BUTTON_WAIT Signed-off-by: Pol Henarejos --- src/button.c | 4 ++-- src/button.h | 4 ++-- src/rescue.c | 2 +- src/usb/hid/hid.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/button.c b/src/button.c index e30bc0d..ded0faa 100644 --- a/src/button.c +++ b/src/button.c @@ -39,9 +39,9 @@ bool is_req_button_pending(void) { return req_button_pending; } -bool cancel_button = false; +volatile bool cancel_button = false; bool touch_accept_button = false; -bool force_button_wait = false; +volatile bool force_button_wait = false; #if !defined(ENABLE_EMULATION) #ifdef ESP_PLATFORM diff --git a/src/button.h b/src/button.h index 5df519d..6271f3b 100644 --- a/src/button.h +++ b/src/button.h @@ -27,8 +27,8 @@ extern int button_wait(void); extern void button_task(void); -extern bool cancel_button; +extern volatile bool cancel_button; extern bool touch_accept_button; -extern bool force_button_wait; +extern volatile bool force_button_wait; #endif // BUTTON_H diff --git a/src/rescue.c b/src/rescue.c index 57f852a..4a2e647 100644 --- a/src/rescue.c +++ b/src/rescue.c @@ -207,7 +207,7 @@ static bool rescue_require_user_presence(void) { return true; #else bool previous_force = force_button_wait; -#ifdef FORCE_WAIT_BUTTON +#ifdef FORCE_BUTTON_WAIT force_button_wait = true; #endif int ret = button_wait(); diff --git a/src/usb/hid/hid.c b/src/usb/hid/hid.c index f8d28a5..27c39a8 100644 --- a/src/usb/hid/hid.c +++ b/src/usb/hid/hid.c @@ -314,7 +314,7 @@ CTAPHID_FRAME last_req = { 0 }; uint32_t lock = 0; uint8_t thread_type = 0; //1 is APDU, 2 is CBOR -extern bool cancel_button; +extern volatile bool cancel_button; extern int cbor_process(uint8_t last_cmd, const uint8_t *data, size_t len); static uint32_t last_keepalive_time = 0;