Charger.num_batteries moved to DcBus.series_multiplier

The reason is that the voltage disconnect thresholds used in the load outputs
need to be multiplied with number of batteries aswell. As the DcBus class
should contain all voltage-relevant information, it is the right place for the
multiplier.
This commit is contained in:
Martin Jäger
2020-03-01 09:48:35 +01:00
parent 651f66616b
commit 1a9c290485
9 changed files with 72 additions and 62 deletions
+2 -4
View File
@@ -72,10 +72,8 @@ int main()
charger.detect_num_batteries(&bat_conf); // check if we have 24V instead of 12V system
charger.init_terminal(&bat_conf);
load.set_voltage_limits(
bat_conf.voltage_load_disconnect * charger.num_batteries,
bat_conf.voltage_load_reconnect * charger.num_batteries,
bat_conf.voltage_absolute_max * charger.num_batteries);
load.set_voltage_limits(bat_conf.voltage_load_disconnect, bat_conf.voltage_load_reconnect,
bat_conf.voltage_absolute_max);
wait(2); // safety feature: be able to re-flash before starting
control_timer_start(CONTROL_FREQUENCY);