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; 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: 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;