Rename DC/DC operation mode and control names

New control states allow to specify the reason for derating more detailed,
also considering the input side.

The operation mode is now also used as a return value for
check_start_conditions function to get rid of magic numbers.
This commit is contained in:
Martin Jäger
2020-10-14 10:03:34 +02:00
parent c38f1c8348
commit db9c9c5b1c
6 changed files with 115 additions and 76 deletions
+2 -2
View File
@@ -133,7 +133,7 @@ void adc_alert_overvoltage_triggering()
prepare_adc_filtered();
adc_update_value(ADC_POS(v_low));
dcdc.state = DCDC_STATE_MPPT;
dcdc.state = DCDC_CONTROL_MPPT;
// overvoltage test
adcval.battery_voltage = bat_conf.voltage_absolute_max + 0.1;
@@ -143,7 +143,7 @@ void adc_alert_overvoltage_triggering()
adc_update_value(ADC_POS(v_low));
TEST_ASSERT_EQUAL(true, dev_stat.has_error(ERR_BAT_OVERVOLTAGE));
TEST_ASSERT_EQUAL(false, pwm_switch.active());
TEST_ASSERT_EQUAL(DCDC_STATE_OFF, dcdc.state);
TEST_ASSERT_EQUAL(DCDC_CONTROL_OFF, dcdc.state);
// reset values
adcval.battery_voltage = 12;