From 72014b777314fad588bb09e0f38b6ed8e3f6d520 Mon Sep 17 00:00:00 2001 From: halfbakery Date: Sun, 31 May 2020 12:46:15 +0200 Subject: [PATCH] Make a previously undocumented switch debouncing feature clean and official --- tasmota/support_switch.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasmota/support_switch.ino b/tasmota/support_switch.ino index 46b642e5b..c13243c0e 100644 --- a/tasmota/support_switch.ino +++ b/tasmota/support_switch.ino @@ -82,8 +82,8 @@ void SwitchProbe(void) if (uptime < 4) { return; } // Block GPIO for 4 seconds after poweron to workaround Wemos D1 / Obi RTS circuit uint8_t state_filter = Settings.switch_debounce / SWITCH_PROBE_INTERVAL; // 5, 10, 15 - uint8_t force_high = (Settings.switch_debounce % 50) &1; // 51, 101, 151 etc - uint8_t force_low = (Settings.switch_debounce % 50) &2; // 52, 102, 152 etc + uint8_t force_high = (Settings.switch_debounce % 10) &1; // 51, 101, 151 etc + uint8_t force_low = (Settings.switch_debounce % 10) &2; // 52, 102, 152 etc for (uint32_t i = 0; i < MAX_SWITCHES; i++) { if (PinUsed(GPIO_SWT1, i)) {