From 76601bced42e33eaa91b079b7fea20425a5ca6c1 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Fri, 26 Jun 2026 18:08:20 +0200 Subject: [PATCH] Fix button force. Signed-off-by: Pol Henarejos --- src/button.c | 6 +++++- src/button.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/button.c b/src/button.c index 8bb686e..e30bc0d 100644 --- a/src/button.c +++ b/src/button.c @@ -41,6 +41,7 @@ bool is_req_button_pending(void) { bool cancel_button = false; bool touch_accept_button = false; +bool force_button_wait = false; #if !defined(ENABLE_EMULATION) #ifdef ESP_PLATFORM @@ -103,10 +104,13 @@ int button_wait(void) { if (phy_data.up_btn_present) { button_timeout = phy_data.up_btn * 1000; } - if (button_timeout == 0) { + if (button_timeout == 0 && !force_button_wait) { signal_emit(SIGNAL_USER_PRESENCE_COMPLETED); return 0; } + if (button_timeout == 0) { + button_timeout = 30000; + } signal_user_presence_request_data_t data = { .timeout = button_timeout / 1000, }; diff --git a/src/button.h b/src/button.h index bf9bea1..5df519d 100644 --- a/src/button.h +++ b/src/button.h @@ -29,5 +29,6 @@ extern int button_wait(void); extern void button_task(void); extern bool cancel_button; extern bool touch_accept_button; +extern bool force_button_wait; #endif // BUTTON_H