From d53ce720d84411c6cd9fcea73fd6f0073ee2a4a2 Mon Sep 17 00:00:00 2001 From: Djair Guilherme Date: Wed, 29 Mar 2023 20:02:00 -0300 Subject: [PATCH 1/3] Update Keypad.h Change the OPEN and CLOSED alias. This is causing many issues with other libraries. --- src/Keypad.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Keypad.h b/src/Keypad.h index 0648114..20560d3 100644 --- a/src/Keypad.h +++ b/src/Keypad.h @@ -52,8 +52,8 @@ do { \ #endif -#define OPEN LOW -#define CLOSED HIGH +#define KEYPAD_OPEN LOW // Many libraries use this alias OPEN , and this cause issues +#define KEYPAD_CLOSED HIGH // Many libraries use this alias CLOSED , and this cause issues typedef char KeypadEvent; typedef unsigned int uint; From a81aa0fb204798645b4f6f8641e4d87a38420f9c Mon Sep 17 00:00:00 2001 From: Djair Guilherme Date: Wed, 29 Mar 2023 20:02:42 -0300 Subject: [PATCH 2/3] Update Key.h --- src/Key.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Key.h b/src/Key.h index 0977fa0..be6c70a 100644 --- a/src/Key.h +++ b/src/Key.h @@ -34,8 +34,8 @@ #include -#define OPEN LOW -#define CLOSED HIGH +#define KEYPAD_OPEN LOW +#define KEYPAD_CLOSED HIGH typedef unsigned int uint; typedef enum{ IDLE, PRESSED, HOLD, RELEASED } KeyState; From 90779b0c6e594d6c43184711fea721e2da518c09 Mon Sep 17 00:00:00 2001 From: Djair Guilherme Date: Wed, 29 Mar 2023 20:03:38 -0300 Subject: [PATCH 3/3] Update Keypad.cpp --- src/Keypad.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Keypad.cpp b/src/Keypad.cpp index f146a6d..86d244d 100644 --- a/src/Keypad.cpp +++ b/src/Keypad.cpp @@ -154,18 +154,18 @@ void Keypad::nextKeyState(byte idx, boolean button) { switch (key[idx].kstate) { case IDLE: - if (button==CLOSED) { + if (button==KEYPAD_CLOSED) { transitionTo (idx, PRESSED); holdTimer = millis(); } // Get ready for next HOLD state. break; case PRESSED: if ((millis()-holdTimer)>holdTime) // Waiting for a key HOLD... transitionTo (idx, HOLD); - else if (button==OPEN) // or for a key to be RELEASED. + else if (button==KEYPAD_OPEN) // or for a key to be RELEASED. transitionTo (idx, RELEASED); break; case HOLD: - if (button==OPEN) + if (button==KEYPAD_OPEN) transitionTo (idx, RELEASED); break; case RELEASED: