MCPcopy Create free account
hub / github.com/cifertech/nRFBox / handleButtonPress

Function handleButtonPress

VScode Platformio/src/spoofer.cpp:284–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282}
283
284void handleButtonPress(int pin, void (*callback)()) {
285 int reading = digitalRead(pin);
286
287 if (reading == LOW) {
288 unsigned long currentTime = millis();
289 delay(300);
290 updateDisplay();
291
292 if ((currentTime - lastDebounceTime) > debounceDelay) {
293 callback();
294 lastDebounceTime = currentTime;
295 }
296 }
297}
298
299void changeDeviceTypeNext() {
300 deviceType++;

Callers 1

spooferLoopFunction · 0.70

Calls 1

updateDisplayFunction · 0.70

Tested by

no test coverage detected