Fixed NMC battery configuration calculation

Now num_cell multiplier is used in all required places.
This commit is contained in:
Hogthrob
2019-06-20 07:26:39 +02:00
parent 690e204a16
commit f26fdce41f
+2 -2
View File
@@ -105,8 +105,8 @@ void battery_conf_init(battery_conf_t *bat, bat_type type, int num_cells, float
case BAT_TYPE_NMC:
case BAT_TYPE_NMC_HV:
bat->voltage_topping = (type == BAT_TYPE_NMC_HV) ? 4.35 : 4.20;
bat->voltage_absolute_max = bat->voltage_topping + 0.05;
bat->voltage_topping = num_cells * ((type == BAT_TYPE_NMC_HV) ? 4.35 : 4.20);
bat->voltage_absolute_max = num_cells * (bat->voltage_topping + 0.05);
bat->voltage_recharge = num_cells * 3.9;
bat->voltage_load_disconnect = num_cells * 3.3;