** Function: InputHandler ** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress **********************************************************************/
| 41 | ** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress |
| 42 | **********************************************************************/ |
| 43 | void InputHandler(void) { |
| 44 | static unsigned long tm = 0; |
| 45 | if (millis() - tm < 200 && !LongPress) return; |
| 46 | |
| 47 | bool upPressed = (axp192.GetBtnPress()); |
| 48 | bool selPressed = (digitalRead(SEL_BTN) == LOW); |
| 49 | bool dwPressed = (digitalRead(DW_BTN) == LOW); |
| 50 | |
| 51 | bool anyPressed = upPressed || selPressed || dwPressed; |
| 52 | if (anyPressed) tm = millis(); |
| 53 | if (anyPressed && wakeUpScreen()) return; |
| 54 | |
| 55 | AnyKeyPress = anyPressed; |
| 56 | PrevPress = upPressed; |
| 57 | EscPress = upPressed; |
| 58 | NextPress = dwPressed; |
| 59 | SelPress = selPressed; |
| 60 | } |
| 61 | |
| 62 | void powerOff() { axp192.PowerOff(); } |
| 63 | #ifndef LITE_VERSION |
nothing calls this directly
no test coverage detected