From ae283aef59d853632a7e609c754b22c114a799c1 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Tue, 10 Dec 2019 13:49:28 +0200 Subject: [PATCH] util: Always return result if not a single press req This also fixes issues with 0 time out. --- bootloader/utils/btn.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bootloader/utils/btn.c b/bootloader/utils/btn.c index 678b19f..8ea5161 100644 --- a/bootloader/utils/btn.c +++ b/bootloader/utils/btn.c @@ -81,5 +81,8 @@ u8 btn_wait_timeout(u32 time_ms, u8 mask) }; // Timed out. - return 0; + if (!single_button) + return (res & mask); + else + return 0; // Return no button press if single button requested. }