1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 06:15:16 +03:00

Add OSD warning options as cli parameters

Previously only a single bitmapped parameter was available in the cli but this wasn't very useful as the users would have to understand the bit positions to enable/disable warning options. This change exposes each warning item as a separate parameter.
This commit is contained in:
Bruce Luckcuck 2018-05-07 18:23:25 -04:00
parent 9b16bf58ac
commit 0916d117b8
4 changed files with 50 additions and 20 deletions

View file

@ -791,7 +791,10 @@ TEST(OsdTest, TestElementWarningsBattery)
{
// given
osdConfigMutable()->item_pos[OSD_WARNINGS] = OSD_POS(9, 10) | VISIBLE_FLAG;
osdConfigMutable()->enabledWarnings = OSD_WARNING_BATTERY_WARNING | OSD_WARNING_BATTERY_CRITICAL | OSD_WARNING_BATTERY_NOT_FULL;
osdConfigMutable()->enabledWarnings = 0; // disable all warnings
osdWarnSetState(OSD_WARNING_BATTERY_WARNING, true);
osdWarnSetState(OSD_WARNING_BATTERY_CRITICAL, true);
osdWarnSetState(OSD_WARNING_BATTERY_NOT_FULL, true);
// and
batteryConfigMutable()->vbatfullcellvoltage = 41;