From e60c561f7023a3d63eab72e207276ef63ea1754b Mon Sep 17 00:00:00 2001 From: Max Prokhorov Date: Fri, 1 May 2020 21:54:53 +0300 Subject: [PATCH] Actually apply button pulldown Properly follow ternary else() chain, help out by pre-pending if() Resolve #2239, thanks to @sigmafx --- code/espurna/button.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/espurna/button.cpp b/code/espurna/button.cpp index a1351f01..0babc2bf 100644 --- a/code/espurna/button.cpp +++ b/code/espurna/button.cpp @@ -79,9 +79,9 @@ constexpr const debounce_event::types::Config _buttonDecodeConfigBitmask(const u ((bitmask & ButtonMask::DefaultHigh) ? debounce_event::types::PinValue::High : debounce_event::types::PinValue::Low), - ((bitmask & ButtonMask::SetPullup) - ? debounce_event::types::PinMode::InputPullup : (bitmask & ButtonMask::SetPulldown) - ? debounce_event::types::PinMode::InputPullup : debounce_event::types::PinMode::Input) + ((bitmask & ButtonMask::SetPullup) ? debounce_event::types::PinMode::InputPullup + : (bitmask & ButtonMask::SetPulldown) ? debounce_event::types::PinMode::InputPulldown + : debounce_event::types::PinMode::Input) }; }