From d886f84b3f705f3af9ac2e08604aa24d571a22a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Thu, 16 Aug 2018 11:25:08 +0200 Subject: [PATCH] Fix zero-based id in _buttonGetActionMask --- code/espurna/button.ino | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/espurna/button.ino b/code/espurna/button.ino index 6b09ac07..50cae7e1 100644 --- a/code/espurna/button.ino +++ b/code/espurna/button.ino @@ -64,10 +64,10 @@ unsigned long _buttonGetActionMask(unsigned char id) { unsigned long pressAction = getSetting("btnPress", id, BUTTON_MODE_NONE).toInt(); unsigned long clickAction = getSetting("btnClick", id, BUTTON_MODE_TOGGLE).toInt(); - unsigned long dblClickAction = getSetting("btnDblClick", id, (id == 1) ? BUTTON_MODE_AP : BUTTON_MODE_NONE).toInt(); - unsigned long lngClickAction = getSetting("btnLngClick", id, (id == 1) ? BUTTON_MODE_RESET : BUTTON_MODE_NONE).toInt(); - unsigned long lnglngClickAction = getSetting("btnLngLngClick", id, (id == 1) ? BUTTON_MODE_FACTORY : BUTTON_MODE_NONE).toInt(); - unsigned long tripleClickAction = getSetting("btnTripleClick", id, (id == 1) ? BUTTON_MODE_NONE : BUTTON_MODE_NONE).toInt(); + unsigned long dblClickAction = getSetting("btnDblClick", id, (id == 0) ? BUTTON_MODE_AP : BUTTON_MODE_NONE).toInt(); + unsigned long lngClickAction = getSetting("btnLngClick", id, (id == 0) ? BUTTON_MODE_RESET : BUTTON_MODE_NONE).toInt(); + unsigned long lnglngClickAction = getSetting("btnLngLngClick", id, (id == 0) ? BUTTON_MODE_FACTORY : BUTTON_MODE_NONE).toInt(); + unsigned long tripleClickAction = getSetting("btnTripleClick", id, (id == 0) ? BUTTON_MODE_NONE : BUTTON_MODE_NONE).toInt(); unsigned long value; value = pressAction;