firmware icon indicating copy to clipboard operation
firmware copied to clipboard

[Bug]: Unnecessary actions are performed by ExternalNotificationModule

Open polarikus opened this issue 1 month ago • 1 comments

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

  1. In InputBroker::handleInputEvent(const InputEvent *event) there's handling to stop externalNotificationModule->stopNow(). Subsequently, this->notifyObservers(event) is called, after which the method externalNotificationModule->stopNow() is called again in the externalNotificationModule itself, in the method ExternalNotificationModule::handleInputEvent(const InputEvent *event).It seems that the handling in InputBroker is not required.
  2. powerFSM.trigger executes 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;
}

polarikus avatar Dec 07 '25 08:12 polarikus

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) .

mverch67 avatar Dec 08 '25 16:12 mverch67