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

ledvinap review (without editing battery.c if statements)

This commit is contained in:
timman2er 2018-08-27 18:21:20 +02:00
parent 3fea35079f
commit 7b196b2ed7
8 changed files with 12 additions and 20 deletions

View file

@ -654,7 +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);
sbufWriteU8(dst, batteryConfig()->forceBatteryCellCount);
break;
case MSP_TRANSPONDER_CONFIG: {
@ -2419,7 +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);
batteryConfigMutable()->forceBatteryCellCount = sbufReadU8(src);
break;
#if defined(USE_OSD)

View file

@ -682,7 +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) },
{ "force_battery_cell_count", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, 80 }, PG_BATTERY_CONFIG, offsetof(batteryConfig_t, forceBatteryCellCount) },
// 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) },