From 009e37e797425581c3f5cb787700a95a14a8a8f7 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Mon, 4 Oct 2021 14:11:32 +0200 Subject: [PATCH] ui: only update ignition when panda is connected (#22425) --- selfdrive/ui/ui.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index 3026e58e07..50a104eb69 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -137,7 +137,10 @@ static void update_state(UIState *s) { if (sm.updated("pandaState")) { auto pandaState = sm["pandaState"].getPandaState(); scene.pandaType = pandaState.getPandaType(); - scene.ignition = pandaState.getIgnitionLine() || pandaState.getIgnitionCan(); + + if (scene.pandaType != cereal::PandaState::PandaType::UNKNOWN) { + scene.ignition = pandaState.getIgnitionLine() || pandaState.getIgnitionCan(); + } } else if ((s->sm->frame - s->sm->rcv_frame("pandaState")) > 5*UI_FREQ) { scene.pandaType = cereal::PandaState::PandaType::UNKNOWN; }