From d5af2cd8ed155fee47bdb02c5d67ddea20d5457e Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Mon, 25 Nov 2024 12:59:25 +0100 Subject: [PATCH] Remove ENABLE_UP_BUTTON macro. Signed-off-by: Pol Henarejos --- CMakeLists.txt | 8 -------- src/fido/fido.c | 7 +------ 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c89573a..c066d63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,14 +39,6 @@ endif() add_executable(pico_fido) endif() -option(ENABLE_UP_BUTTON "Enable/disable user presence button" ON) -if(ENABLE_UP_BUTTON) - add_definitions(-DENABLE_UP_BUTTON=1) - message(STATUS "User presence with button: \t enabled") -else() - add_definitions(-DENABLE_UP_BUTTON=0) - message(STATUS "User presence with button: \t disabled") -endif(ENABLE_UP_BUTTON) option(ENABLE_POWER_ON_RESET "Enable/disable power cycle on reset" ON) if(ENABLE_POWER_ON_RESET) diff --git a/src/fido/fido.c b/src/fido/fido.c index e59d3c2..d63fa46 100644 --- a/src/fido/fido.c +++ b/src/fido/fido.c @@ -389,12 +389,10 @@ void init_fido() { bool wait_button_pressed() { uint32_t val = EV_PRESS_BUTTON; #ifndef ENABLE_EMULATION -#if defined(ENABLE_UP_BUTTON) && ENABLE_UP_BUTTON == 1 queue_try_add(&card_to_usb_q, &val); do { queue_remove_blocking(&usb_to_card_q, &val); } while (val != EV_BUTTON_PRESSED && val != EV_BUTTON_TIMEOUT); -#endif #endif return val == EV_BUTTON_TIMEOUT; } @@ -402,15 +400,12 @@ bool wait_button_pressed() { uint32_t user_present_time_limit = 0; bool check_user_presence() { -#if defined(ENABLE_UP_BUTTON) && ENABLE_UP_BUTTON == 1 - if (user_present_time_limit == 0 || - user_present_time_limit + TRANSPORT_TIME_LIMIT < board_millis()) { + if (user_present_time_limit == 0 || user_present_time_limit + TRANSPORT_TIME_LIMIT < board_millis()) { if (wait_button_pressed() == true) { //timeout return false; } //user_present_time_limit = board_millis(); } -#endif return true; }