diff --git a/Software/src/battery/CHADEMO-BATTERY.cpp b/Software/src/battery/CHADEMO-BATTERY.cpp index 4ca6c7a4..a6ff7c90 100644 --- a/Software/src/battery/CHADEMO-BATTERY.cpp +++ b/Software/src/battery/CHADEMO-BATTERY.cpp @@ -102,7 +102,7 @@ void update_values_battery() { //This function maps all the values fetched via system_capacity_Wh = ((RatedBatteryCapacity / 0.11) * 1000); //(Added in CHAdeMO v1.0.1), maybe handle hardcoded on lower protocol version? - system_remaining_capacity_Wh = (SOC / 100) * capacity_Wh; + system_remaining_capacity_Wh = (system_real_SOC_pptt / 100) * system_capacity_Wh; /* Check if the Vehicle is still sending CAN messages. If we go 60s without messages we raise an error*/ if (!CANstillAlive) { diff --git a/Software/src/battery/KIA-HYUNDAI-64-BATTERY.cpp b/Software/src/battery/KIA-HYUNDAI-64-BATTERY.cpp index d05e5229..d9d7c448 100644 --- a/Software/src/battery/KIA-HYUNDAI-64-BATTERY.cpp +++ b/Software/src/battery/KIA-HYUNDAI-64-BATTERY.cpp @@ -205,10 +205,10 @@ void update_values_battery() { //This function maps all the values fetched via // Check if cell voltages are within allowed range cell_deviation_mV = (system_cell_max_voltage_mV - system_cell_min_voltage_mV); - if (cell_max_voltage >= MAX_CELL_VOLTAGE) { + if (CellVoltMax_mV >= MAX_CELL_VOLTAGE) { set_event(EVENT_CELL_OVER_VOLTAGE, 0); } - if (cell_min_voltage <= MIN_CELL_VOLTAGE) { + if (CellVoltMin_mV <= MIN_CELL_VOLTAGE) { set_event(EVENT_CELL_UNDER_VOLTAGE, 0); } if (cell_deviation_mV > MAX_CELL_DEVIATION) {