Conversation
A source that is switched off with the beeper off mask was still selected as the current beeper entry, the mask was only evaluated when the output was actually driven. A high priority source that is retriggered on every update, such as HW_FAILURE while a sensor is unhealthy, therefore replaced every enabled lower priority source again and again, so nothing could be heard at all any more - not even the beeper mode on an RC channel. Reject a switched off source in beeper() so it never becomes the current entry and the output stays available for the sources that are enabled. Fixes iNavFlight#9580
Raffi1202
marked this pull request as ready for review
September 11, 2026 15:51
Contributor
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoPrevent masked beeper sources from blocking enabled alerts
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can switch off images and animations for a plain-text comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With
beeper -HW_FAILUREset and the beeper mode assigned to an RC channel, the external beeper responds to the switch only while all hardware is healthy. As soon as the GPS receiver is disconnected the beeper stops; the same happens withbeeper -BAT_LOWonce the battery is low. The only workaround isbeeper all. Reported in #9580 (Speedybee F405 V3, INAV 7.0.0).Fixes #9580
Cause
beeper()does not consult the off mask when it selects a source; the mask is applied only where the output is driven (src/main/io/beeper.c:359 on maintenance-10.x). A masked source therefore still becomescurrentBeeperEntryand wins the priority comparison at src/main/io/beeper.c:238.beeperUpdate()requestsBEEPER_RX_SET(priority 10) for the switch and thenBEEPER_HARDWARE_FAILURE(priority 1) on every loop while a sensor is unhealthy (src/main/io/beeper.c:318-333). The failure sequence runs silently, ends inbeeperSilence(), and is re-selected on the next loop, so the enabled source never reaches the output.Change
beeper()now returns early when the requested mode is set in the off mask, so a switched-off source never becomescurrentBeeperEntry. The existing mask checks at the output stay in place, so a mask changed while a sequence is already running still takes effect. Because a masked source no longer becomes the current entry, it also no longer blinks the warning LED (warningLedEnable()at src/main/io/beeper.c:362 ran regardless of the mask).Test
Not run on hardware or SITL. Cause verified by reading src/main/io/beeper.c:219-253 and :318-362 on maintenance-10.x against the steps in #9580;
pwm_mapping_beeper_unittest.cccovers timer pad mapping only, notbeeper(). Compiled for all targets and the four SITL builds on the fork, green: https://github.com/Raffi1202/inav/actions/runs/34770677230Flash / RAM
Builds clean on all targets. No size comparison yet: the fork build has no baseline for this branch, and the upstream size report runs once CI is released for this PR.
Docs
No documentation change needed: docs/Buzzer.md:70 already states that a minus in front of a name disables that source, which is the behaviour this change restores; nothing documents the previous blocking or the warning LED.