Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/bms.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ void bms_update(BMS *bms, const CfgBMS *cfg, const Time *time) {
const float timeout = 5.0f;

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