From 6a02fa8380751f788eddf7d5cdba525215cbcdad Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 24 Nov 2016 10:30:32 +0100 Subject: [PATCH] Drop the single-aritiy keyswitch state helpers They are not used anywhere, and as such, are a distraction. The states will be reworked into something similar that was now dropped, but that's a separate patch. Signed-off-by: Gergely Nagy --- src/keyswitch_state.cpp | 33 --------------------------------- src/keyswitch_state.h | 5 ----- 2 files changed, 38 deletions(-) diff --git a/src/keyswitch_state.cpp b/src/keyswitch_state.cpp index c7aca528..760d4f41 100644 --- a/src/keyswitch_state.cpp +++ b/src/keyswitch_state.cpp @@ -3,14 +3,6 @@ #define PRESSED B00000001 -boolean key_was_pressed (byte keyState) { - if ( keyState & B00001000 || keyState & B00000100) { - return true; - } else { - return false; - } -} - boolean key_was_pressed (uint8_t currentState, uint8_t previousState) { if (previousState & PRESSED) { return true; @@ -19,14 +11,6 @@ boolean key_was_pressed (uint8_t currentState, uint8_t previousState) { } } -boolean key_is_pressed (byte keyState) { - if ( keyState & B00000001 && keyState & B00000010 ) { - return true; - } else { - return false; - } -} - boolean key_is_pressed (uint8_t currentState, uint8_t previousState) { if (currentState & PRESSED) { return true; @@ -35,14 +19,6 @@ boolean key_is_pressed (uint8_t currentState, uint8_t previousState) { } } -boolean key_toggled_on(byte keyState) { - if (key_is_pressed(keyState) && ! key_was_pressed(keyState)) { - return true; - } else { - return false; - } -} - boolean key_toggled_on (uint8_t currentState, uint8_t previousState) { if ((currentState & PRESSED) && ! (previousState & PRESSED) ) { return true; @@ -51,15 +27,6 @@ boolean key_toggled_on (uint8_t currentState, uint8_t previousState) { } } - -boolean key_toggled_off(byte keyState) { - if (key_was_pressed(keyState) && ! key_is_pressed(keyState)) { - return true; - } else { - return false; - } -} - boolean key_toggled_off (uint8_t currentState, uint8_t previousState) { if ((previousState & PRESSED) && ! (currentState & PRESSED) ) { return true; diff --git a/src/keyswitch_state.h b/src/keyswitch_state.h index 810b4e68..ae672736 100644 --- a/src/keyswitch_state.h +++ b/src/keyswitch_state.h @@ -5,11 +5,6 @@ #define INJECTED B10000000 -boolean key_was_pressed (byte keyState); -boolean key_is_pressed (byte keyState); -boolean key_toggled_on(byte keyState); -boolean key_toggled_off(byte keyState); - boolean key_was_pressed (uint8_t currentState, uint8_t previousState); boolean key_is_pressed (uint8_t currentState, uint8_t previousState); boolean key_toggled_on(uint8_t currentState, uint8_t previousState);