** Function: InputHandler ** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress **********************************************************************/
| 96 | ** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress |
| 97 | **********************************************************************/ |
| 98 | void InputHandler(void) { |
| 99 | static unsigned long tm = 0; |
| 100 | if (millis() - tm < 200 && !LongPress) return; |
| 101 | bool _u = digitalRead(UP_BTN); |
| 102 | bool _d = digitalRead(DW_BTN); |
| 103 | bool _l = digitalRead(L_BTN); |
| 104 | bool _r = digitalRead(R_BTN); |
| 105 | bool _s = digitalRead(SEL_BTN); |
| 106 | |
| 107 | if (!_s || !_u || !_d || !_r || !_l) { |
| 108 | tm = millis(); |
| 109 | if (!wakeUpScreen()) AnyKeyPress = true; |
| 110 | else return; |
| 111 | } |
| 112 | if (!_l) { PrevPress = true; } |
| 113 | if (!_r) { NextPress = true; } |
| 114 | if (!_u) { |
| 115 | UpPress = true; |
| 116 | PrevPagePress = true; |
| 117 | } |
| 118 | if (!_d) { |
| 119 | DownPress = true; |
| 120 | NextPagePress = true; |
| 121 | } |
| 122 | if (!_s) { SelPress = true; } |
| 123 | if (!_l && !_r) { |
| 124 | EscPress = true; |
| 125 | NextPress = false; |
| 126 | PrevPress = false; |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | /********************************************************************* |
| 131 | ** Function: powerOff |
no test coverage detected