** Function: InputHandler ** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress **********************************************************************/
| 140 | ** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress |
| 141 | **********************************************************************/ |
| 142 | void InputHandler(void) { |
| 143 | static unsigned long tm = 0; |
| 144 | if (millis() - tm < 200 && !LongPress) return; |
| 145 | bool _u = digitalRead(UP_BTN) == BTN_ACT; |
| 146 | bool _d = digitalRead(DW_BTN) == BTN_ACT; |
| 147 | bool _l = digitalRead(L_BTN) == BTN_ACT; |
| 148 | bool _r = digitalRead(R_BTN) == BTN_ACT; |
| 149 | bool _s = digitalRead(SEL_BTN) == BTN_ACT; |
| 150 | bool _e = digitalRead(ESC_BTN) == BTN_ACT; |
| 151 | |
| 152 | if (_s || _u || _d || _r || _l || _e) { |
| 153 | tm = millis(); |
| 154 | if (!wakeUpScreen()) AnyKeyPress = true; |
| 155 | else return; |
| 156 | } |
| 157 | if (_l) { PrevPress = true; } |
| 158 | if (_r) { NextPress = true; } |
| 159 | if (_u) { UpPress = true; } |
| 160 | if (_d) { DownPress = true; } |
| 161 | if (_s) { SelPress = true; } |
| 162 | if (_e) { EscPress = true; } |
| 163 | } |
| 164 | |
| 165 | /********************************************************************* |
| 166 | ** Function: powerOff |
no test coverage detected