OnroadHud: update engageability and DM icons at 2Hz (#23134)

old-commit-hash: 5ab6bff67016585edbbec134123c54db2e471599
This commit is contained in:
Dean Lee
2021-12-06 04:54:35 +08:00
committed by GitHub
parent a9a5f1933e
commit 53c7684956
3 changed files with 6 additions and 10 deletions
-6
View File
@@ -110,12 +110,6 @@ static void update_state(UIState *s) {
UIScene &scene = s->scene;
s->running_time = 1e-9 * (nanos_since_boot() - sm["deviceState"].getDeviceState().getStartedMonoTime());
// update engageability and DM icons at 2Hz
if (sm.frame % (UI_FREQ / 2) == 0) {
auto cs = sm["controlsState"].getControlsState();
scene.engageable = cs.getEngageable() || cs.getEnabled();
scene.dm_active = sm["driverMonitoringState"].getDriverMonitoringState().getIsActiveMode();
}
if (sm.updated("modelV2") && s->vg) {
update_model(s, sm["modelV2"].getModelV2());
}