From 4509019d646325a323fc6f3c5d1439da48a029de Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 28 Jan 2019 18:04:33 +0100 Subject: [PATCH] Fix valid button range check Fix valid button range check --- sonoff/support.ino | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sonoff/support.ino b/sonoff/support.ino index 91d1f7633..b2e74addc 100644 --- a/sonoff/support.ino +++ b/sonoff/support.ino @@ -713,6 +713,12 @@ bool GetUsedInModule(uint8_t val, uint8_t *arr) if ((val >= GPIO_KEY1_NP) && (val < GPIO_KEY1_NP + MAX_KEYS)) { offset = -(GPIO_KEY1_NP - GPIO_KEY1); } + if ((val >= GPIO_KEY1_INV) && (val < GPIO_KEY1_INV + MAX_KEYS)) { + offset = -(GPIO_KEY1_INV - GPIO_KEY1); + } + if ((val >= GPIO_KEY1_INV_NP) && (val < GPIO_KEY1_INV_NP + MAX_KEYS)) { + offset = -(GPIO_KEY1_INV_NP - GPIO_KEY1); + } if ((val >= GPIO_SWT1) && (val < GPIO_SWT1 + MAX_SWITCHES)) { offset = (GPIO_SWT1_NP - GPIO_SWT1);