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

Function taskInputHandler

src/main.cpp:60–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58
59TaskHandle_t xHandle;
60void __attribute__((weak)) taskInputHandler(void *parameter) {
61 auto timer = millis();
62 while (true) {
63 checkPowerSaveTime();
64 // Sometimes this task run 2 or more times before looptask,
65 // and navigation gets stuck, the idea here is run the input detection
66 // if AnyKeyPress is false, or rerun if it was not renewed within 75ms (arbitrary)
67 // because AnyKeyPress will be true if didn´t passed through a check(bool var)
68 if (!AnyKeyPress || millis() - timer > 75) {
69 NextPress = false;
70 PrevPress = false;
71 UpPress = false;
72 DownPress = false;
73 SelPress = false;
74 EscPress = false;
75 AnyKeyPress = false;
76 SerialCmdPress = false;
77 NextPagePress = false;
78 PrevPagePress = false;
79 touchPoint.pressed = false;
80 touchPoint.Clear();
81#ifndef USE_TFT_eSPI_TOUCH
82 InputHandler();
83#endif
84 timer = millis();
85 }
86 vTaskDelay(pdMS_TO_TICKS(10));
87 }
88}
89// Public Globals Variables
90unsigned long previousMillis = millis();
91int prog_handler; // 0 - Flash, 1 - LittleFS, 3 - Download

Callers

nothing calls this directly

Calls 4

millisFunction · 0.85
checkPowerSaveTimeFunction · 0.85
InputHandlerFunction · 0.50
ClearMethod · 0.45

Tested by

no test coverage detected