Skip to content

Multifunction add battery voltage warnings#11308

Open
breadoven wants to merge 7 commits intoiNavFlight:maintenance-9.xfrom
breadoven:abo_add_batt_volt_warning
Open

Multifunction add battery voltage warnings#11308
breadoven wants to merge 7 commits intoiNavFlight:maintenance-9.xfrom
breadoven:abo_add_batt_volt_warning

Conversation

@breadoven
Copy link
Collaborator

@breadoven breadoven commented Feb 2, 2026

User description

Adds battery voltage warning to Multifunction OSD element.

Also changes the warning display logic. The warnings now display constantly without blinking with the exception of new warnings which are displayed individually for 10s with blinking to highlight the fact it's a new warning. After the 10s all current warnings are displayed on a 1s cycle without blinking. The multifunction option to redisplay warnings has been removed as it's no longer needed.

Minor bug fixed causing inconsistency checking battery voltage status when battery capacity being used for battery status.

Should close #11259.


PR Type

Enhancement


Description

  • Adds battery voltage warning to multifunction OSD element

  • Introduces configurable warning cycle time setting (0-60s)

  • Separates voltage and capacity battery warnings for clarity

  • Updates warning display logic to use configurable cycle time


Diagram Walkthrough

flowchart LR
  A["Battery Voltage State"] -->|Check voltage| B["VBATT CRIT/LOW Warning"]
  C["Multifunction Warning Cycle Time Setting"] -->|Configure display duration| D["Warning Redisplay Logic"]
  B -->|Display in full| E["Multifunction OSD Element"]
  D -->|Apply cycle time| E
Loading

File Walkthrough

Relevant files
Enhancement
osd.c
Implement voltage warning and configurable cycle time       

src/main/io/osd.c

  • Added multifunction_warning_cycle_time field initialization in OSD
    config reset template
  • Updated warning redisplay logic to use configurable cycle time instead
    of hardcoded 30s
  • Added battery voltage state checking with separate VBATT CRIT/LOW
    warnings
  • Increased messages array size from 7 to 8 to accommodate new voltage
    warning
  • Updated comment to reflect dynamic warning cycle time behavior
+12/-4   
Configuration changes
osd.h
Add warning cycle time configuration field                             

src/main/io/osd.h

  • Added multifunction_warning_cycle_time field to osdConfig_s structure
  • Field stores cycle time in seconds for multifunction warning display
+1/-0     
settings.yaml
Register warning cycle time in settings schema                     

src/main/fc/settings.yaml

  • Added multifunction_warning_cycle_time setting definition to OSD
    settings group
  • Configured with min value 0, max value 60, default value 30
  • Included description explaining warning display behavior
+7/-0     
Documentation
Settings.md
Document multifunction warning cycle time setting               

docs/Settings.md

  • Added documentation for multifunction_warning_cycle_time setting
  • Documented default value of 30s with range 0-60s
  • Explained behavior when set to 0 (always display warnings in full)
+10/-0   

@breadoven breadoven added this to the 9.1 milestone Feb 2, 2026
@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Feb 2, 2026

PR Compliance Guide 🔍

All compliance sections have been disabled in the configurations.

@sensei-hacker
Copy link
Member

Thanks, Breadoven.
Historically, when adding new settings, requiring a PG version bump and full erase, have we done that on minor versions? Or major version?

@breadoven
Copy link
Collaborator Author

Thanks, Breadoven. Historically, when adding new settings, requiring a PG version bump and full erase, have we done that on minor versions? Or major version?

Looking at 7.0 to 7.1 there were new settings added, e.g. #9502, which I'd have thought required a PG version bump, although #9502 omitted it ... I assume by mistake. Having said that I've missed the PG version bump for this PR so it needs adding before merging.

@sensei-hacker
Copy link
Member

sensei-hacker commented Mar 1, 2026

I got curious and did a little audit of 5.0 → 5.1 → 6.0 → 6.1 → 7.0 → 7.1 → 8.0 → 9.0

PG struct changes are normally in major versions.

But of 60 struct changes I found, 15 missed the version bump. I added a release-time check for that.

  • 4.1 → 5.0: 8 modified
  • 5.1 → 6.0: 14 modified
  • 6.1 → 7.0: 8 modified
  • 7.1 → 8.0: 16 modified
  • 8.0 → 9.0: 10 modified

  • 5.0 → 5.1: 1 modified
  • 6.0 → 6.1: 0 modified
  • 7.0 → 7.1: 3 modified

If nobody disagrees, I think I'm going to schedule PG changes (and requiring a full erase) for major versions.
Which puts this at milestone 10.0.

Unless the setting isn't really needed. It's possible that we have too dang many settings already, making it hard for users to know which settings they actually need to pay attention to. 😊

@breadoven
Copy link
Collaborator Author

The setting could be pushed to 10.0 with just the voltage warning added for 9.1. In that case it's probably best to just have the warnings display constantly which shouldn't be a problem now the blinking has been removed which is much less distracting.

@breadoven
Copy link
Collaborator Author

This has now been changed to remove the setting entirely. The warnings now display constantly without blinking with the exception of new warnings which are displayed individually for 10s with blinking to highlight the fact it's a new warning. After the 10s all current warnings are displayed on a 1s cycle without blinking.

@robertbulko
Copy link

I would like to see the list of warnings and how (in what exact form/text) they appear. Is it available somewhere?

@breadoven
Copy link
Collaborator Author

I would like to see the list of warnings and how (in what exact form/text) they appear. Is it available somewhere?

Battery voltage:
"VBATT LOW " then "VBATT LAND"

Battery capacity:
"BATT DYING" then "BATT EMPTY"

Sensor warnings:
"GPS FAILED" and "NO GPS FIX"
"MAG FAILED"
"PITOT FAIL"

Sanity warnings:
"RTH SANITY" - triggered if craft heads too far in the wrong direction
"ALT SANITY" - triggered if there's too big a mismatch between the estimated and GPS altitudes

@robertbulko
Copy link

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants