Fix else-if statement

This commit is contained in:
Daniel 2024-02-26 11:57:03 +02:00
parent be662e4fe0
commit c4a78d19cf

View file

@ -202,8 +202,7 @@ void update_values_battery() { //This function maps all the values fetched via
//The allowed charge power behaves strangely. We instead estimate this value //The allowed charge power behaves strangely. We instead estimate this value
if (system_scaled_SOC_pptt == 10000) { // When scaled SOC is 100.00%, set allowed charge power to 0 if (system_scaled_SOC_pptt == 10000) { // When scaled SOC is 100.00%, set allowed charge power to 0
system_max_charge_power_W = 0; system_max_charge_power_W = 0;
} } else if (soc_vi > 990) {
if (soc_vi > 990) {
system_max_charge_power_W = FLOAT_MAX_POWER_W; system_max_charge_power_W = FLOAT_MAX_POWER_W;
} else if (soc_vi > RAMPDOWN_SOC) { // When real SOC is between RAMPDOWN_SOC-99%, ramp the value between Max<->0 } else if (soc_vi > RAMPDOWN_SOC) { // When real SOC is between RAMPDOWN_SOC-99%, ramp the value between Max<->0
system_max_charge_power_W = MAXCHARGEPOWERALLOWED * (1 - (soc_vi - RAMPDOWN_SOC) / (1000.0 - RAMPDOWN_SOC)); system_max_charge_power_W = MAXCHARGEPOWERALLOWED * (1 - (soc_vi - RAMPDOWN_SOC) / (1000.0 - RAMPDOWN_SOC));