Merge pull request #1507 from jonny5532/fix/rjxzs-cell-count

Fix cellvoltages index on RJXZS population
This commit is contained in:
Daniel Öster 2025-09-08 11:33:31 +03:00 committed by GitHub
commit 354926a6b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -147,10 +147,10 @@ void RjxzsBms::handle_incoming_can_frame(CAN_frame rx_frame) {
if (cell_index + i >= MAX_AMOUNT_CELLS) {
break;
}
cellvoltages[i] = (rx_frame.data.u8[1 + i * 2] << 8) | rx_frame.data.u8[2 + i * 2];
if (cell_index + i >= populated_cellvoltages) {
populated_cellvoltages = cell_index + i + 1;
}
cellvoltages[cell_index + i] = (rx_frame.data.u8[1 + i * 2] << 8) | rx_frame.data.u8[2 + i * 2];
}
if (cell_index + 2 >= populated_cellvoltages) {
populated_cellvoltages = cell_index + 2 + 1;
}
} else if (mux == 0x47) {
temperature_below_zero_mod1_4 = rx_frame.data.u8[2];