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:
+2
-4
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user