only run the ButtonThread if a button is pressed

This commit is contained in:
Links2004
2025-09-24 17:14:22 +02:00
parent 0b4a28866b
commit 85cdcad194
2 files changed
+12 -1

No files matched your search

+6 -1
View File
@@ -274,7 +274,12 @@ int32_t ButtonThread::runOnce()
}
}
btnEvent = BUTTON_EVENT_NONE;
return 50;
// only pull when the button is pressed, we get notified via IRQ on a new press
if (!userButton.isIdle() || waitingForLongPress) {
return 50;
}
return INT32_MAX;
}
/*