wait 5s before showing waiting for controls
This commit is contained in:
parent
847fc1fefe
commit
d6571aa633
|
@ -244,14 +244,13 @@ void ui_update(UIState *s) {
|
|||
}
|
||||
|
||||
// Handle controls timeout
|
||||
bool controls_timeout = ((s->sm)->frame - (s->sm)->rcv_frame("controlsState")) > 10*UI_FREQ;
|
||||
if (s->started && !s->scene.frontview && controls_timeout) {
|
||||
if (s->started && !s->scene.frontview && ((s->sm)->frame - s->started_frame) > 5*UI_FREQ) {
|
||||
if ((s->sm)->rcv_frame("controlsState") < s->started_frame) {
|
||||
// car is started, but controlsState hasn't been seen at all
|
||||
s->scene.alert_text1 = "openpilot Unavailable";
|
||||
s->scene.alert_text2 = "Waiting for controls to start";
|
||||
s->scene.alert_size = cereal::ControlsState::AlertSize::MID;
|
||||
} else {
|
||||
} else if (((s->sm)->frame - (s->sm)->rcv_frame("controlsState")) > 5*UI_FREQ) {
|
||||
// car is started, but controls is lagging or died
|
||||
if (s->scene.alert_text2 != "Controls Unresponsive") {
|
||||
s->sound->play(AudibleAlert::CHIME_WARNING_REPEAT);
|
||||
|
|
Loading…
Reference in a new issue