BugFix calculate number of cell in KIA pack

This commit is contained in:
amarofarinha 2024-06-09 10:21:41 +01:00
parent 0b1749a82c
commit 3c3999877d

View file

@ -276,10 +276,6 @@ void receive_can_battery(CAN_frame_t rx_frame) {
startedUp = true;
datalayer.battery.status.CAN_battery_still_alive = CAN_STILL_ALIVE;
SOC_Display = rx_frame.data.u8[0] * 5; //100% = 200 ( 200 * 5 = 1000 )
//Map all cell voltages to the global array
memcpy(datalayer.battery.status.cell_voltages_mV, cellvoltages_mv, 98 * sizeof(uint16_t));
//Update number of cells
update_number_of_cells();
break;
case 0x594:
startedUp = true;
@ -488,6 +484,10 @@ void receive_can_battery(CAN_frame_t rx_frame) {
}
break;
case 0x26: //Sixth datarow in PID group
//Map all cell voltages to the global array
memcpy(datalayer.battery.status.cell_voltages_mV, cellvoltages_mv, 98 * sizeof(uint16_t));
//Update number of cells
update_number_of_cells();
break;
case 0x27: //Seventh datarow in PID group
if (poll_data_pid == 1) {