Skip to content

beeper: play the success sequence when a config save completes - #11923

Open
Raffi1202 wants to merge 2 commits into
iNavFlight:maintenance-10.xfrom
Raffi1202:fix/beeper-stick-save
Open

Raffi1202 wants to merge 2 commits into
iNavFlight:maintenance-10.xfrom
Raffi1202:fix/beeper-stick-save

Conversation

@Raffi1202

@Raffi1202 Raffi1202 commented Sep 10, 2026

Copy link
Copy Markdown

Problem

Saving settings with the stick command gives no audible sign that the save actually completed. The reporter of #8359 flies without goggles when maidening and tuning: the beep after the gesture only says that some stick input was seen, so a wrong gesture and a completed save sound the same, and the OSD "EEPROM SAVED" notice is not visible. Fixes #8359.

Cause

src/main/fc/config.c:381 on maintenance-10.x: processSaveConfigAndNotify() calls beeperConfirmationBeeps(1), a single 20 ms tick (src/main/io/beeper.c:156). The same tick is used for a blocked arm (src/main/fc/fc_core.c:643), a flight-mode change (src/main/fc/runtime_config.c:100) and a downward inflight adjustment (src/main/fc/rc_adjustments.c:381).

Change

Replaces the tick with beeper(BEEPER_ACTION_SUCCESS), the existing two-short-beeps sequence (src/main/io/beeper.c:117) that the stick handler already plays for waypoint list save and load (src/main/fc/rc_controls.c:273). It sounds after writeEEPROM() and readEEPROM() return, so it reports the completed write, not the gesture. Every saveConfigAndNotify() caller (stick command, CMS, calibrations, autotrim) gets the same sequence; Configurator saves via MSP_EEPROM_WRITE (src/main/fc/fc_msp.c:3088) do not use this path and are unchanged. No new setting, beeper mode or MSP change.

Test

Not run on hardware or SITL. Cause verified by reading the files above on maintenance-10.x;

Flash / RAM

Not measured yet. The upstream firmware CI has not been released for this PR, so no size report exists.

Docs

docs/Buzzer.md: the success-beep row now names the settings save as a second meaning. Its index and name were also stale (the table said 10 ACC_CALIBRATION where beeper.c has 11 ACTION_SUCCESS) and are corrected. The rest of that table is off by one against beeper.c and is left for its own pass.

Saving the configuration already beeped, but it used
beeperConfirmationBeeps(1), a single 20 ms tick that is identical to the
generic single-beep acknowledgement emitted for blocked arming and for
inflight adjustments. Without an OSD there was no way to tell a
completed write from any other stick command acknowledgement.

processSaveConfigAndNotify() now plays BEEPER_ACTION_SUCCESS instead,
two short 50 ms beeps. It is emitted after writeEEPROM() and readEEPROM()
have returned, so it confirms that the settings really were written and
read back, not merely that a stick gesture was seen.

BEEPER_ACTION_SUCCESS is an existing table entry, already used for the
waypoint list save and load in the same stick command handler, so the
sound is one pilots already associate with "that worked". Reusing it
leaves the beeperMode_e ordering, the beeper name table and the beeper
mask bit numbering exposed over MSP untouched.

The beep belongs in the save path rather than in the stick handler
because the gesture only queues the write, the commit itself happens in
a later loop iteration via processDelayedSave(). Placing it there also
covers the remaining notify-saves, which is intended: every one of them
already raises the OSD "EEPROM SAVED" notification, so the audible cue
now matches the visual one. Configurator saves are unchanged, as
MSP_EEPROM_WRITE does not use this path, and profile switching is
unchanged as well, since it writes the EEPROM directly and keeps its
"N beeps means profile N" confirmation.

Ref iNavFlight#8359
@Raffi1202
Raffi1202 marked this pull request as ready for review September 11, 2026 15:39
@qodo-code-review

Copy link
Copy Markdown
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

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Play distinct success beeps after configuration saves

🐞 Bug fix 🕐 Less than 5 minutes

Grey Divider

AI Description

• Replaces the generic save acknowledgement with the existing two-beep success sequence.
• Plays confirmation only after configuration is written and read back.
• Applies audible completion feedback across all notified configuration save paths.
Diagram

sequenceDiagram
    participant Caller as Save Trigger
    participant Config as Config Save
    participant RX as RX Signal
    participant EEPROM
    participant Beeper
    participant OSD
    Caller->>Config: Request notified save
    Config->>RX: Suspend signal
    Config->>EEPROM: Write settings
    Config->>EEPROM: Read settings
    Config->>RX: Resume signal
    Config->>Beeper: Play success
    opt OSD enabled
        Config->>OSD: Show saved notice
    end
Loading
High-Level Assessment

The centralized save-completion path is the appropriate location for this feedback because it covers every notified save route and confirms persistence rather than gesture recognition. Reusing BEEPER_ACTION_SUCCESS also avoids introducing a new beeper mode or changing MSP-visible ordering and masks.

Files changed (1) +2 / -1

Bug fix (1) +2 / -1
config.cEmit distinct success feedback after configuration persistence +2/-1

Emit distinct success feedback after configuration persistence

• Replaces the generic single confirmation tick with the existing BEEPER_ACTION_SUCCESS sequence after EEPROM write, reload, and RX resumption. This makes completed saves audibly distinguishable from ordinary stick-command acknowledgements across every caller of the notified save path.

src/main/fc/config.c

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can switch off images and animations for a plain-text comment

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

A save by stick command now plays this sequence, so the row needed the
second meaning. Its index and name were also stale: the table said 10
ACC_CALIBRATION where beeper.c has 11 ACTION_SUCCESS. Only this row is
corrected - the rest of the table is off by one against beeper.c and is
worth its own pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant