mirror of
https://github.com/meshtastic/firmware.git
synced 2025-10-04 14:15:53 +00:00
only run the ButtonThread if a button is pressed
This commit is contained in:
parent
0b4a28866b
commit
85cdcad194
@ -274,7 +274,12 @@ int32_t ButtonThread::runOnce()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
btnEvent = BUTTON_EVENT_NONE;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1002,6 +1002,7 @@ void setup()
|
|||||||
config.pullupSense = INPUT_PULLUP;
|
config.pullupSense = INPUT_PULLUP;
|
||||||
config.intRoutine = []() {
|
config.intRoutine = []() {
|
||||||
UserButtonThread->userButton.tick();
|
UserButtonThread->userButton.tick();
|
||||||
|
UserButtonThread->setIntervalFromNow(0);
|
||||||
runASAP = true;
|
runASAP = true;
|
||||||
BaseType_t higherWake = 0;
|
BaseType_t higherWake = 0;
|
||||||
mainDelay.interruptFromISR(&higherWake);
|
mainDelay.interruptFromISR(&higherWake);
|
||||||
@ -1022,6 +1023,7 @@ void setup()
|
|||||||
touchConfig.pullupSense = pullup_sense;
|
touchConfig.pullupSense = pullup_sense;
|
||||||
touchConfig.intRoutine = []() {
|
touchConfig.intRoutine = []() {
|
||||||
TouchButtonThread->userButton.tick();
|
TouchButtonThread->userButton.tick();
|
||||||
|
TouchButtonThread->setIntervalFromNow(0);
|
||||||
runASAP = true;
|
runASAP = true;
|
||||||
BaseType_t higherWake = 0;
|
BaseType_t higherWake = 0;
|
||||||
mainDelay.interruptFromISR(&higherWake);
|
mainDelay.interruptFromISR(&higherWake);
|
||||||
@ -1041,6 +1043,7 @@ void setup()
|
|||||||
cancelConfig.pullupSense = pullup_sense;
|
cancelConfig.pullupSense = pullup_sense;
|
||||||
cancelConfig.intRoutine = []() {
|
cancelConfig.intRoutine = []() {
|
||||||
CancelButtonThread->userButton.tick();
|
CancelButtonThread->userButton.tick();
|
||||||
|
CancelButtonThread->setIntervalFromNow(0);
|
||||||
runASAP = true;
|
runASAP = true;
|
||||||
BaseType_t higherWake = 0;
|
BaseType_t higherWake = 0;
|
||||||
mainDelay.interruptFromISR(&higherWake);
|
mainDelay.interruptFromISR(&higherWake);
|
||||||
@ -1061,6 +1064,7 @@ void setup()
|
|||||||
backConfig.pullupSense = pullup_sense;
|
backConfig.pullupSense = pullup_sense;
|
||||||
backConfig.intRoutine = []() {
|
backConfig.intRoutine = []() {
|
||||||
BackButtonThread->userButton.tick();
|
BackButtonThread->userButton.tick();
|
||||||
|
BackButtonThread->setIntervalFromNow(0);
|
||||||
runASAP = true;
|
runASAP = true;
|
||||||
BaseType_t higherWake = 0;
|
BaseType_t higherWake = 0;
|
||||||
mainDelay.interruptFromISR(&higherWake);
|
mainDelay.interruptFromISR(&higherWake);
|
||||||
@ -1095,6 +1099,7 @@ void setup()
|
|||||||
userConfig.pullupSense = pullup_sense;
|
userConfig.pullupSense = pullup_sense;
|
||||||
userConfig.intRoutine = []() {
|
userConfig.intRoutine = []() {
|
||||||
UserButtonThread->userButton.tick();
|
UserButtonThread->userButton.tick();
|
||||||
|
UserButtonThread->setIntervalFromNow(0);
|
||||||
runASAP = true;
|
runASAP = true;
|
||||||
BaseType_t higherWake = 0;
|
BaseType_t higherWake = 0;
|
||||||
mainDelay.interruptFromISR(&higherWake);
|
mainDelay.interruptFromISR(&higherWake);
|
||||||
@ -1112,6 +1117,7 @@ void setup()
|
|||||||
userConfigNoScreen.pullupSense = pullup_sense;
|
userConfigNoScreen.pullupSense = pullup_sense;
|
||||||
userConfigNoScreen.intRoutine = []() {
|
userConfigNoScreen.intRoutine = []() {
|
||||||
UserButtonThread->userButton.tick();
|
UserButtonThread->userButton.tick();
|
||||||
|
UserButtonThread->setIntervalFromNow(0);
|
||||||
runASAP = true;
|
runASAP = true;
|
||||||
BaseType_t higherWake = 0;
|
BaseType_t higherWake = 0;
|
||||||
mainDelay.interruptFromISR(&higherWake);
|
mainDelay.interruptFromISR(&higherWake);
|
||||||
|
Loading…
Reference in New Issue
Block a user