mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-04 10:19:29 +02:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
59921a61a5
commit
8e1ece817e
2 changed files with 6 additions and 6 deletions
|
@ -149,7 +149,7 @@ void MgHsPHEVBattery::handle_incoming_can_frame(CAN_frame rx_frame) {
|
|||
// 0/8 = checking
|
||||
|
||||
#ifdef DEBUG_LOG
|
||||
if(rx_frame.data.u8[1] != previousState) {
|
||||
if (rx_frame.data.u8[1] != previousState) {
|
||||
logging.printf("MG_HS_PHEV: Battery status changed to %d (%d)\n", rx_frame.data.u8[1], rx_frame.data.u8[0]);
|
||||
}
|
||||
#endif
|
||||
|
@ -165,19 +165,19 @@ void MgHsPHEVBattery::handle_incoming_can_frame(CAN_frame rx_frame) {
|
|||
if (datalayer.battery.status.bms_status == FAULT) {
|
||||
// If in fault state, don't try resetting things yet as it'll turn the
|
||||
// BMS off and we'll lose CAN info
|
||||
} else if((rx_frame.data.u8[0] == 0x02 || rx_frame.data.u8[0] == 0x06) && rx_frame.data.u8[1] == 0x01) {
|
||||
} else if ((rx_frame.data.u8[0] == 0x02 || rx_frame.data.u8[0] == 0x06) && rx_frame.data.u8[1] == 0x01) {
|
||||
// A weird 'stuck' state where the battery won't reconnect
|
||||
datalayer.system.status.battery_allows_contactor_closing = false;
|
||||
if(!datalayer.system.status.BMS_startup_in_progress) {
|
||||
if (!datalayer.system.status.BMS_startup_in_progress) {
|
||||
#ifdef DEBUG_LOG
|
||||
logging.printf("MG_HS_PHEV: Stuck, resetting.\n");
|
||||
#endif
|
||||
start_bms_reset();
|
||||
}
|
||||
} else if(rx_frame.data.u8[1] == 0xf) {
|
||||
} else if (rx_frame.data.u8[1] == 0xf) {
|
||||
// A fault state (likely isolation failure)
|
||||
datalayer.system.status.battery_allows_contactor_closing = false;
|
||||
if(!datalayer.system.status.BMS_startup_in_progress) {
|
||||
if (!datalayer.system.status.BMS_startup_in_progress) {
|
||||
#ifdef DEBUG_LOG
|
||||
logging.printf("MG_HS_PHEV: Fault, resetting.\n");
|
||||
#endif
|
||||
|
|
|
@ -34,7 +34,7 @@ class MgHsPHEVBattery : public CanBattery {
|
|||
float RealVoltage;
|
||||
float RealSoC;
|
||||
float tempfloat;
|
||||
|
||||
|
||||
uint8_t previousState = 0;
|
||||
|
||||
static const uint16_t CELL_VOLTAGE_TIMEOUT = 10; // in seconds
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue