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