** Function: InputHandler ** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress **********************************************************************/
| 56 | ** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress |
| 57 | **********************************************************************/ |
| 58 | void InputHandler(void) { |
| 59 | static unsigned long tm = 0; |
| 60 | if (millis() - tm < 200 && !LongPress) return; |
| 61 | |
| 62 | bool upPressed = (digitalRead(UP_BTN) == LOW); |
| 63 | bool selPressed = (digitalRead(SEL_BTN) == LOW); |
| 64 | bool dwPressed = (digitalRead(DW_BTN) == LOW); |
| 65 | |
| 66 | bool anyPressed = upPressed || selPressed || dwPressed; |
| 67 | if (anyPressed) tm = millis(); |
| 68 | if (anyPressed && wakeUpScreen()) return; |
| 69 | |
| 70 | AnyKeyPress = anyPressed; |
| 71 | PrevPress = upPressed; |
| 72 | EscPress = upPressed; |
| 73 | NextPress = dwPressed; |
| 74 | SelPress = selPressed; |
| 75 | } |
| 76 | |
| 77 | /********************************************************************* |
| 78 | ** Function: powerOff |
nothing calls this directly
no test coverage detected