Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch parameters with battery capacity unit #10389

Conversation

MrD-RC
Copy link
Collaborator

@MrD-RC MrD-RC commented Sep 27, 2024

There is a parameter for the OSD called osd_stats_energy_unit. This selects whether mAh or Wh are displayed on the end of flight stats screen. People are confused the when the switch the battery capacity unit to Wh from Ah, this value doesn't change.

This PR will change osd_stats_energy_unit to match the battery capacity unit if it changes. This will be more an expected behavior. Plus it gives pilots the option to change to the other units for the stats if they want.

There is a parameter for the OSD called `osd_stats_energy_unit`. This selects whether mAh or Wh are displayed on the end of flight stats screen. People are confused the when the switch the battery capacity unit to Wh from Ah, this value doesn't change.

This PR will change `osd_stats_energy_unit` to match the battery capacity unit if it changes. This will be more an expected behavior. Plus it gives pilots the option to change to the other units for the stats if they want.
@MrD-RC MrD-RC added this to the 8.0 milestone Sep 27, 2024
@MrD-RC MrD-RC merged commit 678434f into master Sep 28, 2024
21 checks passed
@MrD-RC MrD-RC deleted the MrD-Switch-some-additional-settings-when-changing-battery-capacity-unit branch September 28, 2024 09:20
@breadoven
Copy link
Collaborator

This appears to be causing a lockup on disarm on some configurations. Happens on a couple of planes with F4 boards, but not on a multirotor with an F7 board, could be the board or airframe type ?. It's caused by the cli.c change. With that change included it locks up immediately when you disarm, doesn't when your remove it.

@MrD-RC
Copy link
Collaborator Author

MrD-RC commented Oct 14, 2024

Thanks @breadoven. I came across the issue at the weekend. Thanks for finding the cause. I hadn't had time to investigate. I'll work on a fix.

@breadoven
Copy link
Collaborator

Seems it's caused by battery_capacity_unit being set to MWH. The quad was set to MAH and wasn't affected but if you change it to MWH it locks up on disarm. I'm guessing some sort of Config mismatch perhaps.

Have to admit I completely discounted this change as the culprit when I was checking the master merge changes to find the cause. A pain to diagnose when it locks up completely.

@MrD-RC
Copy link
Collaborator Author

MrD-RC commented Oct 14, 2024

@breadoven yes, the issue is when osd_stats_energy_unit = wh rather than the change here. This change has just highlighted the issue. It's more likely related to the disarm screen on the OSD. Switching osd_stats_energy_unit to mah without changing any code gets rid of the disarm hang.

@breadoven
Copy link
Collaborator

You're right, setting osd_stats_energy_unit = wh causes the same lockup even with the cli.c code removed.

@MrD-RC
Copy link
Collaborator Author

MrD-RC commented Oct 15, 2024

Fixed in #10413

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.

3 participants