mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-09 06:32:06 +00:00
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:
parent
b1955c34aa
commit
feafd2bc0c
@ -300,14 +300,23 @@ int32_t ButtonThread::runOnce()
|
|||||||
#ifdef BUTTON_PIN_TOUCH
|
#ifdef BUTTON_PIN_TOUCH
|
||||||
case BUTTON_EVENT_TOUCH_LONG_PRESSED: {
|
case BUTTON_EVENT_TOUCH_LONG_PRESSED: {
|
||||||
LOG_BUTTON("Touch press!");
|
LOG_BUTTON("Touch press!");
|
||||||
if (screen) {
|
// Ignore if: no screen
|
||||||
|
if (!screen)
|
||||||
|
break;
|
||||||
|
|
||||||
|
#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
|
// Wake if asleep
|
||||||
if (powerFSM.getState() == &stateDARK)
|
if (powerFSM.getState() == &stateDARK)
|
||||||
powerFSM.trigger(EVENT_PRESS);
|
powerFSM.trigger(EVENT_PRESS);
|
||||||
|
|
||||||
// Update display (legacy behaviour)
|
// Update display (legacy behaviour)
|
||||||
screen->forceDisplay();
|
screen->forceDisplay();
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif // BUTTON_PIN_TOUCH
|
#endif // BUTTON_PIN_TOUCH
|
||||||
|
Loading…
Reference in New Issue
Block a user