From 6c8e15dadd7ae4477349a980b79f3a160ad66a78 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 28 Jan 2019 10:18:44 +0100 Subject: [PATCH] Fix inverted buttons Fix inverted buttons --- sonoff/support_button.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonoff/support_button.ino b/sonoff/support_button.ino index 092c50a97..63726a05e 100644 --- a/sonoff/support_button.ino +++ b/sonoff/support_button.ino @@ -121,7 +121,7 @@ void ButtonHandler(void) } else { if (pin[GPIO_KEY1 +button_index] < 99) { button_present = 1; - button = (digitalRead(pin[GPIO_KEY1 +button_index]) != key_inverted); + button = (digitalRead(pin[GPIO_KEY1 +button_index]) != bitRead(key_inverted, button_index)); } }