MCPcopy Create free account
hub / github.com/BruceDevices/firmware / InputHandler

Function InputHandler

boards/m5stack-cplus1_1/interface.cpp:43–60  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

41** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress
42**********************************************************************/
43void InputHandler(void) {
44 static unsigned long tm = 0;
45 if (millis() - tm < 200 && !LongPress) return;
46
47 bool upPressed = (axp192.GetBtnPress());
48 bool selPressed = (digitalRead(SEL_BTN) == LOW);
49 bool dwPressed = (digitalRead(DW_BTN) == LOW);
50
51 bool anyPressed = upPressed || selPressed || dwPressed;
52 if (anyPressed) tm = millis();
53 if (anyPressed && wakeUpScreen()) return;
54
55 AnyKeyPress = anyPressed;
56 PrevPress = upPressed;
57 EscPress = upPressed;
58 NextPress = dwPressed;
59 SelPress = selPressed;
60}
61
62void powerOff() { axp192.PowerOff(); }
63#ifndef LITE_VERSION

Callers

nothing calls this directly

Calls 3

millisFunction · 0.85
wakeUpScreenFunction · 0.85
GetBtnPressMethod · 0.80

Tested by

no test coverage detected