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