From 80c5bfb44c60cfa9a906d70180c310a138273dbe Mon Sep 17 00:00:00 2001 From: Comma Device Date: Tue, 15 Dec 2020 14:16:47 -0800 Subject: [PATCH] fix camera malfunction ui timeout old-commit-hash: 54c6931b5cbf1bc0e064f9a3c45d012ffcfbfdea --- selfdrive/ui/ui.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index 68c45e4333..08b929fb61 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -285,7 +285,8 @@ void ui_update(UIState *s) { const uint64_t frame_pkt = (s->sm)->rcv_frame("frame"); const uint64_t frame_delayed = (s->sm)->frame - frame_pkt; - if ((frame_pkt > s->started_frame && frame_delayed > 5 * UI_FREQ) || frame_delayed > 35 * UI_FREQ) { + const uint64_t since_started = (s->sm)->frame - s->started_frame; + if ((frame_pkt > s->started_frame || since_started > 15*UI_FREQ) && frame_delayed > 5*UI_FREQ) { // controls is fine, but rear camera is lagging or died s->scene.alert_text1 = "Camera Malfunction"; s->scene.alert_text2 = "Contact Support";