Skip to content

Commit d557e19

Browse files
mjclukash
authored andcommitted
Suppress placeholder BMS faults during startup grace
1 parent 9191f65 commit d557e19

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎src/bms.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@ void bms_update(BMS *bms, const CfgBMS *cfg, const Time *time) {
4444
const float timeout = 5.0f;
4545

4646
// Before the first BMS update occurs right after startup, msg_age has its
47-
// init value. We need to wait the `timeout` time before issuing errors.
48-
if (bms->msg_age > timeout && time_elapsed(time, start, timeout)) {
49-
set_fault(&fault_mask, BMSF_CONNECTION);
47+
// init value. Suppress all telemetry faults until the grace period expires.
48+
if (bms->msg_age > timeout) {
49+
if (time_elapsed(time, start, timeout)) {
50+
set_fault(&fault_mask, BMSF_CONNECTION);
51+
}
5052
bms->fault_mask = fault_mask;
5153
return;
5254
}

0 commit comments

Comments
 (0)