fix: Prevent time sync check on FREE frames

Co-authored-by: aider (gemini/gemini-2.5-pro-preview-05-06) <aider@aider.chat>
This commit is contained in:
Chaos Rogers 2025-07-10 14:28:17 +01:00
parent 8d834b22fd
commit 18b71c6fa6

View file

@ -77,14 +77,6 @@ impl LtcState {
match frame.status.as_str() { match frame.status.as_str() {
"LOCK" => { "LOCK" => {
self.lock_count += 1; self.lock_count += 1;
}
"FREE" => {
self.free_count += 1;
self.clear_offsets();
self.last_match_status = "UNKNOWN".into();
}
_ => {}
}
// Every 5 seconds, recompute whether HH:MM:SS matches local time // Every 5 seconds, recompute whether HH:MM:SS matches local time
let now_secs = Utc::now().timestamp(); let now_secs = Utc::now().timestamp();
@ -96,6 +88,14 @@ impl LtcState {
}; };
self.last_match_check = now_secs; self.last_match_check = now_secs;
} }
}
"FREE" => {
self.free_count += 1;
self.clear_offsets();
self.last_match_status = "UNKNOWN".into();
}
_ => {}
}
self.latest = Some(frame); self.latest = Some(frame);
} }