mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-21 05:52:06 +08:00
ui: only update ignition when panda is connected (#22425)
This commit is contained in:
+4
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user