firmware
firmware copied to clipboard
[Bug]: Unnecessary actions are performed by ExternalNotificationModule
Category
Other
Hardware
Not Applicable
Is this bug report about any UI component firmware like InkHUD or Meshtatic UI (MUI)?
- [ ] Meshtastic UI aka MUI colorTFT
- [ ] InkHUD ePaper
- [ ] OLED slide UI on any display
Firmware Version
2.7.15.567b8ea
Description
- In
InputBroker::handleInputEvent(const InputEvent *event)there's handling to stopexternalNotificationModule->stopNow(). Subsequently,this->notifyObservers(event)is called, after which the methodexternalNotificationModule->stopNow()is called again in the externalNotificationModule itself, in the methodExternalNotificationModule::handleInputEvent(const InputEvent *event).It seems that the handling in InputBroker is not required. -
powerFSM.triggerexecutes on long presses, there's even a TODO note about this.
Relevant log output
int InputBroker::handleInputEvent(const InputEvent *event)
{
if (isNeedTriggerPowerFSM(event)) {
LOG_DEBUG("InputBroker: NeedTriggerPowerFSM");
powerFSM.trigger(EVENT_INPUT); // todo: not every input should wake, like long hold release
}
if (event && event->inputEvent != INPUT_BROKER_NONE && externalNotificationModule &&
moduleConfig.external_notification.enabled) {
externalNotificationModule->stopNow();
}
this->notifyObservers(event);
return 0;
}
int ExternalNotificationModule::handleInputEvent(const InputEvent *event)
{
if (nagCycleCutoff != UINT32_MAX) {
stopNow();
return 1;
}
return 0;
}
This has been fixed already in 2.7.16 by https://github.com/meshtastic/firmware/pull/8601 (and related bugfix https://github.com/meshtastic/firmware/pull/8884) .