1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-21 15:25:36 +03:00

Fix incorrect merge in battery_unittest

batteryConfig initialization was merged twice, removing one version
This commit is contained in:
Petr Ledvina 2015-03-10 08:32:36 +01:00
parent 44b36107a6
commit f1a0972002

View file

@ -37,10 +37,9 @@ typedef struct batteryAdcToVoltageExpectation_s {
TEST(BatteryTest, BatteryADCToVoltage) TEST(BatteryTest, BatteryADCToVoltage)
{ {
// given // batteryInit() reads a bunch of fields including vbatscale, so set up the config with useful initial values:
batteryConfig_t batteryConfig = { batteryConfig_t batteryConfig = {
.vbatscale = 110, .vbatscale = VBAT_SCALE_DEFAULT,
.vbatmaxcellvoltage = 43, .vbatmaxcellvoltage = 43,
.vbatmincellvoltage = 33, .vbatmincellvoltage = 33,
.vbatwarningcellvoltage = 35, .vbatwarningcellvoltage = 35,
@ -51,14 +50,6 @@ TEST(BatteryTest, BatteryADCToVoltage)
.batteryCapacity = 2200, .batteryCapacity = 2200,
}; };
// batteryInit() reads a bunch of fields including vbatscale, so set up the config with useful initial values:
memset(&batteryConfig, 0, sizeof(batteryConfig));
batteryConfig.vbatmaxcellvoltage = 43;
batteryConfig.vbatmincellvoltage = 33;
batteryConfig.vbatwarningcellvoltage = 35;
batteryConfig.vbatscale = VBAT_SCALE_DEFAULT;
batteryInit(&batteryConfig); batteryInit(&batteryConfig);
batteryAdcToVoltageExpectation_t batteryAdcToVoltageExpectations[] = { batteryAdcToVoltageExpectation_t batteryAdcToVoltageExpectations[] = {