Add group check to sixth datarow

This commit is contained in:
Daniel Öster 2025-06-19 00:04:16 +03:00
parent 447955acb2
commit 7e3eb74e06

View file

@ -362,6 +362,7 @@ void KiaHyundai64Battery::handle_incoming_can_frame(CAN_frame rx_frame) {
}
break;
case 0x26: //Sixth datarow in PID group
if (poll_data_pid == 5) {
//We have read all cells, check that content is valid:
for (uint8_t i = 85; i < 97; ++i) {
if (cellvoltages_mv[i] < 300) { // Zero the value if it's below 300
@ -372,6 +373,7 @@ void KiaHyundai64Battery::handle_incoming_can_frame(CAN_frame rx_frame) {
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) {