mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-04 18:29:48 +02:00
Update PYLON-CAN.cpp
- Swap Status information, charge/discharge
This commit is contained in:
parent
58730a0989
commit
18b2b727a0
1 changed files with 2 additions and 2 deletions
|
@ -215,9 +215,9 @@ void update_values_can_inverter() { //This function maps all the values fetched
|
|||
PYLON_4211.data.u8[7] = (datalayer.battery.status.soh_pptt / 100);
|
||||
|
||||
// Status=Bit 0,1,2= 0:Sleep, 1:Charge, 2:Discharge 3:Idle. Bit3 ForceChargeReq. Bit4 Balance charge Request
|
||||
if (datalayer.battery.status.current_dA > 0) {
|
||||
if (datalayer.battery.status.current_dA < 0) {
|
||||
PYLON_4251.data.u8[0] = (0x11); // Charge
|
||||
} else if (datalayer.battery.status.current_dA < 0) {
|
||||
} else if (datalayer.battery.status.current_dA > 0) {
|
||||
PYLON_4251.data.u8[0] = (0x12); // Discharge
|
||||
} else if (datalayer.battery.status.current_dA == 0) {
|
||||
PYLON_4251.data.u8[0] = (0x13); // Idle
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue