mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-05 10:49:42 +02:00
Add status bit writing to 4250
This commit is contained in:
parent
cb3713c91e
commit
2a6dca1d31
1 changed files with 4 additions and 0 deletions
|
@ -196,12 +196,16 @@ void update_values_can_inverter() { //This function maps all the values fetched
|
|||
|
||||
// Status=Bit 0,1,2= 0:Sleep, 1:Charge, 2:Discharge 3:Idle. Bit3 ForceChargeReq. Bit4 Balance charge Request
|
||||
if (datalayer.battery.status.bms_status == FAULT) {
|
||||
PYLON_4250.data.u8[0] = (0x00); // Sleep
|
||||
PYLON_4251.data.u8[0] = (0x00); // Sleep
|
||||
} else if (datalayer.battery.status.current_dA < 0) {
|
||||
PYLON_4250.data.u8[0] = (0x01); // Charge
|
||||
PYLON_4251.data.u8[0] = (0x01); // Charge
|
||||
} else if (datalayer.battery.status.current_dA > 0) {
|
||||
PYLON_4250.data.u8[0] = (0x02); // Discharge
|
||||
PYLON_4251.data.u8[0] = (0x02); // Discharge
|
||||
} else if (datalayer.battery.status.current_dA == 0) {
|
||||
PYLON_4250.data.u8[0] = (0x03); // Idle
|
||||
PYLON_4251.data.u8[0] = (0x03); // Idle
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue