Protect T-Echo's touch button against phantom presses in OLED UI (#6735)

* Guard T-Echo touch button during LoRa TX

* Guard for T-Echo only

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
todd-herbert 2025-05-14 23:33:51 +12:00 committed by GitHub
parent b1955c34aa
commit feafd2bc0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -300,14 +300,23 @@ int32_t ButtonThread::runOnce()
#ifdef BUTTON_PIN_TOUCH
case BUTTON_EVENT_TOUCH_LONG_PRESSED: {
LOG_BUTTON("Touch press!");
if (screen) {
// Wake if asleep
if (powerFSM.getState() == &stateDARK)
powerFSM.trigger(EVENT_PRESS);
// Ignore if: no screen
if (!screen)
break;
// Update display (legacy behaviour)
screen->forceDisplay();
}
#ifdef TTGO_T_ECHO
// Ignore if: TX in progress
// Uncommon T-Echo hardware bug, LoRa TX triggers touch button
if (!RadioLibInterface::instance || RadioLibInterface::instance->isSending())
break;
#endif
// Wake if asleep
if (powerFSM.getState() == &stateDARK)
powerFSM.trigger(EVENT_PRESS);
// Update display (legacy behaviour)
screen->forceDisplay();
break;
}
#endif // BUTTON_PIN_TOUCH