Always keep display on with ignition (#2138)

* keep display on with ignition

* fix typo

Co-authored-by: Willem Melching <willem.melching@gmail.com>
This commit is contained in:
Adeeb Shihadeh 2020-09-07 04:13:10 -07:00 committed by GitHub
parent 6b0ac6c8b7
commit e386133c4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View file

@ -222,7 +222,7 @@ int main(int argc, char* argv[]) {
}
// manage wakefulness
if (s->started) {
if (s->started || s->ignition) {
set_awake(s, true);
}

View file

@ -199,7 +199,9 @@ void update_sockets(UIState *s) {
}
}
if (sm.updated("health")) {
scene.hwType = sm["health"].getHealth().getHwType();
auto health = sm["health"].getHealth();
scene.hwType = health.getHwType();
s->ignition = health.getIgnitionLine() || health.getIgnitionCan();
} else if ((s->sm->frame - s->sm->rcv_frame("health")) > 5*UI_FREQ) {
scene.hwType = cereal::HealthData::HwType::UNKNOWN;
}

View file

@ -200,6 +200,7 @@ typedef struct UIState {
std::atomic<float> light_sensor;
bool started;
bool ignition;
bool is_metric;
bool longitudinal_control;
uint64_t last_athena_ping;