mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
add way to manually override battery cell count
This commit is contained in:
parent
793c5f7b71
commit
3fea35079f
8 changed files with 24 additions and 1 deletions
|
@ -654,6 +654,7 @@ static bool mspCommonProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst, mspPostProce
|
|||
sbufWriteU16(dst, batteryConfig()->batteryCapacity);
|
||||
sbufWriteU8(dst, batteryConfig()->voltageMeterSource);
|
||||
sbufWriteU8(dst, batteryConfig()->currentMeterSource);
|
||||
sbufWriteU8(dst, batteryConfig()->setBatteryCellCount);
|
||||
break;
|
||||
|
||||
case MSP_TRANSPONDER_CONFIG: {
|
||||
|
@ -2418,6 +2419,7 @@ static mspResult_e mspCommonProcessInCommand(uint8_t cmdMSP, sbuf_t *src, mspPos
|
|||
batteryConfigMutable()->batteryCapacity = sbufReadU16(src);
|
||||
batteryConfigMutable()->voltageMeterSource = sbufReadU8(src);
|
||||
batteryConfigMutable()->currentMeterSource = sbufReadU8(src);
|
||||
batteryConfigMutable()->setBatteryCellCount = sbufReadU8(src);
|
||||
break;
|
||||
|
||||
#if defined(USE_OSD)
|
||||
|
|
|
@ -682,6 +682,7 @@ const clivalue_t valueTable[] = {
|
|||
{ "use_cbat_alerts", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_BATTERY_CONFIG, offsetof(batteryConfig_t, useConsumptionAlerts) },
|
||||
{ "cbat_alert_percent", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, 100 }, PG_BATTERY_CONFIG, offsetof(batteryConfig_t, consumptionWarningPercentage) },
|
||||
{ "vbat_cutoff_percent", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, 100 }, PG_BATTERY_CONFIG, offsetof(batteryConfig_t, lvcPercentage) },
|
||||
{ "set_battery_cell_count", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 10, 80 }, PG_BATTERY_CONFIG, offsetof(batteryConfig_t, setBatteryCellCount) },
|
||||
|
||||
// PG_VOLTAGE_SENSOR_ADC_CONFIG
|
||||
{ "vbat_scale", VAR_UINT8 | MASTER_VALUE, .config.minmax = { VBAT_SCALE_MIN, VBAT_SCALE_MAX }, PG_VOLTAGE_SENSOR_ADC_CONFIG, offsetof(voltageSensorADCConfig_t, vbatscale) },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue