mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 17:59:27 +02:00
Merge pull request #1507 from jonny5532/fix/rjxzs-cell-count
Fix cellvoltages index on RJXZS population
This commit is contained in:
commit
354926a6b3
1 changed files with 4 additions and 4 deletions
|
@ -147,10 +147,10 @@ void RjxzsBms::handle_incoming_can_frame(CAN_frame rx_frame) {
|
||||||
if (cell_index + i >= MAX_AMOUNT_CELLS) {
|
if (cell_index + i >= MAX_AMOUNT_CELLS) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
cellvoltages[i] = (rx_frame.data.u8[1 + i * 2] << 8) | rx_frame.data.u8[2 + i * 2];
|
cellvoltages[cell_index + 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;
|
|
||||||
}
|
}
|
||||||
|
if (cell_index + 2 >= populated_cellvoltages) {
|
||||||
|
populated_cellvoltages = cell_index + 2 + 1;
|
||||||
}
|
}
|
||||||
} else if (mux == 0x47) {
|
} else if (mux == 0x47) {
|
||||||
temperature_below_zero_mod1_4 = rx_frame.data.u8[2];
|
temperature_below_zero_mod1_4 = rx_frame.data.u8[2];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue