MCPcopy Create free account
hub / github.com/bmorcelli/Launcher / InputHandler

Function InputHandler

boards/reaper/interface.cpp:142–163  ·  view source on GitHub ↗

** Function: InputHandler ** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress **********************************************************************/

Source from the content-addressed store, hash-verified

140** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress
141**********************************************************************/
142void 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

Callers 2

taskInputHandlerFunction · 0.50
checkFunction · 0.50

Calls 1

wakeUpScreenFunction · 0.85

Tested by

no test coverage detected