1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 16:55:36 +03:00

Merge pull request #10112 from knoopx/cms-config-min-warn-batt

feat: add additional min/warn battery cell voltages to CMS
This commit is contained in:
Michael Keller 2020-08-21 10:33:45 +12:00 committed by GitHub
commit 8807c544c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,9 @@
voltageMeterSource_e batteryConfig_voltageMeterSource;
currentMeterSource_e batteryConfig_currentMeterSource;
uint16_t batteryConfig_vbatmincellvoltage;
uint16_t batteryConfig_vbatmaxcellvoltage;
uint16_t batteryConfig_vbatwarningcellvoltage;
uint8_t voltageSensorADCConfig_vbatscale;
@ -61,7 +63,9 @@ static const void *cmsx_Power_onEnter(displayPort_t *pDisp)
batteryConfig_voltageMeterSource = batteryConfig()->voltageMeterSource;
batteryConfig_currentMeterSource = batteryConfig()->currentMeterSource;
batteryConfig_vbatmincellvoltage = batteryConfig()->vbatmincellvoltage;
batteryConfig_vbatmaxcellvoltage = batteryConfig()->vbatmaxcellvoltage;
batteryConfig_vbatwarningcellvoltage = batteryConfig()->vbatwarningcellvoltage;
voltageSensorADCConfig_vbatscale = voltageSensorADCConfig(0)->vbatscale;
@ -84,7 +88,9 @@ static const void *cmsx_Power_onExit(displayPort_t *pDisp, const OSD_Entry *self
batteryConfigMutable()->voltageMeterSource = batteryConfig_voltageMeterSource;
batteryConfigMutable()->currentMeterSource = batteryConfig_currentMeterSource;
batteryConfigMutable()->vbatmincellvoltage = batteryConfig_vbatmincellvoltage;
batteryConfigMutable()->vbatmaxcellvoltage = batteryConfig_vbatmaxcellvoltage;
batteryConfigMutable()->vbatwarningcellvoltage = batteryConfig_vbatwarningcellvoltage;
voltageSensorADCConfigMutable(0)->vbatscale = voltageSensorADCConfig_vbatscale;
@ -106,7 +112,9 @@ static const OSD_Entry cmsx_menuPowerEntries[] =
{ "V METER", OME_TAB, NULL, &(OSD_TAB_t){ &batteryConfig_voltageMeterSource, VOLTAGE_METER_COUNT - 1, voltageMeterSourceNames }, REBOOT_REQUIRED },
{ "I METER", OME_TAB, NULL, &(OSD_TAB_t){ &batteryConfig_currentMeterSource, CURRENT_METER_COUNT - 1, currentMeterSourceNames }, REBOOT_REQUIRED },
{ "VBAT CLMIN", OME_UINT16, NULL, &(OSD_UINT16_t) { &batteryConfig_vbatmincellvoltage, VBAT_CELL_VOTAGE_RANGE_MIN, VBAT_CELL_VOTAGE_RANGE_MAX, 1 }, 0 },
{ "VBAT CLMAX", OME_UINT16, NULL, &(OSD_UINT16_t) { &batteryConfig_vbatmaxcellvoltage, VBAT_CELL_VOTAGE_RANGE_MIN, VBAT_CELL_VOTAGE_RANGE_MAX, 1 }, 0 },
{ "VBAT CLWARN", OME_UINT16, NULL, &(OSD_UINT16_t) { &batteryConfig_vbatwarningcellvoltage, VBAT_CELL_VOTAGE_RANGE_MIN, VBAT_CELL_VOTAGE_RANGE_MAX, 1 }, 0 },
{ "VBAT SCALE", OME_UINT8, NULL, &(OSD_UINT8_t){ &voltageSensorADCConfig_vbatscale, VBAT_SCALE_MIN, VBAT_SCALE_MAX, 1 }, 0 },