Skip to content

Commit 6787d23

Browse files
committed
BMS fixes (not faulting in 2 ways)
1 parent 1337180 commit 6787d23

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

BMS/src/BmsThread.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,12 +413,15 @@ void BMSThread::threadWorker() {
413413
} else {
414414
ThisThread::sleep_for(100ms); // 100 ms
415415
}
416-
if (bmsState == BMSThreadState::BMSFaultRecover) {
416+
if (bmsState == BMSThreadState::BMSFaultRecover && !(minVoltage <= BMS_FAULT_VOLTAGE_THRESHOLD_LOW ||
417+
maxVoltage >= BMS_FAULT_VOLTAGE_THRESHOLD_HIGH ||
418+
minTemp <= BMS_FAULT_TEMP_THRESHOLD_LOW ||
419+
maxTemp >= BMS_FAULT_TEMP_THRESHOLD_HIGH)) {
417420
bmsState = BMSThreadState::BMSIdle;
418421
}
419422
}
420423
}
421424

422425
void BMSThread::throwBmsFault() {
423-
// bmsState = BMSThreadState::BMSFault;
426+
bmsState = BMSThreadState::BMSFault;
424427
}

0 commit comments

Comments
 (0)