mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-05 02:39:57 +02:00
BugFix calculate number of cell in KIA pack
This commit is contained in:
parent
0b1749a82c
commit
3c3999877d
1 changed files with 4 additions and 4 deletions
|
@ -276,10 +276,6 @@ void receive_can_battery(CAN_frame_t rx_frame) {
|
||||||
startedUp = true;
|
startedUp = true;
|
||||||
datalayer.battery.status.CAN_battery_still_alive = CAN_STILL_ALIVE;
|
datalayer.battery.status.CAN_battery_still_alive = CAN_STILL_ALIVE;
|
||||||
SOC_Display = rx_frame.data.u8[0] * 5; //100% = 200 ( 200 * 5 = 1000 )
|
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;
|
break;
|
||||||
case 0x594:
|
case 0x594:
|
||||||
startedUp = true;
|
startedUp = true;
|
||||||
|
@ -488,6 +484,10 @@ void receive_can_battery(CAN_frame_t rx_frame) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x26: //Sixth datarow in PID group
|
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;
|
break;
|
||||||
case 0x27: //Seventh datarow in PID group
|
case 0x27: //Seventh datarow in PID group
|
||||||
if (poll_data_pid == 1) {
|
if (poll_data_pid == 1) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue