only run the ButtonThread if a button is pressed

This commit is contained in:
Links2004
2025-09-24 16:58:15 +02:00
parent 0b4a28866b
commit 85cdcad194
2 changed files with 12 additions and 1 deletions

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;
}
/*