mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-02 03:52:11 +08:00
ui: only update ignition when panda is connected (#22425)
old-commit-hash: 009e37e797425581c3f5cb787700a95a14a8a8f7
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