** Function: InputHandler ** Handles the variables PrevPress, NextPress, check(SelPress), AnyKeyPress and EscPress **********************************************************************/
| 37 | ** Handles the variables PrevPress, NextPress, check(SelPress), AnyKeyPress and EscPress |
| 38 | **********************************************************************/ |
| 39 | void InputHandler(void) { |
| 40 | M5.update(); |
| 41 | static unsigned long tm = 0; |
| 42 | if (millis() - tm < 200 && !LongPress) return; |
| 43 | |
| 44 | bool aPressed = (M5.BtnA.isPressed()); |
| 45 | bool bPressed = (M5.BtnB.isPressed()); |
| 46 | bool cPressed = (M5.BtnC.isPressed()); |
| 47 | |
| 48 | bool anyPressed = aPressed || bPressed || cPressed; |
| 49 | if (anyPressed) tm = millis(); |
| 50 | if (anyPressed && wakeUpScreen()) return; |
| 51 | |
| 52 | AnyKeyPress = anyPressed; |
| 53 | PrevPress = aPressed; |
| 54 | EscPress = aPressed; |
| 55 | NextPress = cPressed; |
| 56 | SelPress = bPressed; |
| 57 | } |
| 58 | |
| 59 | /********************************************************************* |
| 60 | ** Function: powerOff |
nothing calls this directly
no test coverage detected