From 4df20acf6575b6a0a57145701e60684b80e6a064 Mon Sep 17 00:00:00 2001 From: dragonpilot Date: Mon, 16 Mar 2020 13:52:48 +1000 Subject: [PATCH] * turn speed (text) to yellow when braking. --- selfdrive/ui/paint.cc | 2 +- selfdrive/ui/ui.cc | 1 + selfdrive/ui/ui.hpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/paint.cc b/selfdrive/ui/paint.cc index 3b9957eba..a22f18705 100644 --- a/selfdrive/ui/paint.cc +++ b/selfdrive/ui/paint.cc @@ -671,7 +671,7 @@ static void ui_draw_vision_speed(UIState *s) { nvgFontFace(s->vg, "sans-regular"); nvgFontSize(s->vg, 36*2.5); - nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 200)); + nvgFillColor(s->vg, s->scene.brakeLights? COLOR_YELLOW : nvgRGBA(255, 255, 255, 200)); if (s->is_metric) { nvgText(s->vg, viz_speed_x+viz_speed_w/2, 320, "kph", NULL); diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index 79b51be0a..4fb9376ad 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -548,6 +548,7 @@ void handle_message(UIState *s, Message * msg) { } s->scene.leftBlinker = datad.leftBlinker; s->scene.rightBlinker = datad.rightBlinker; + s->scene.brakeLights = datad.brakeLights; } capn_free(&ctx); } diff --git a/selfdrive/ui/ui.hpp b/selfdrive/ui/ui.hpp index 384f469c2..c4986b687 100644 --- a/selfdrive/ui/ui.hpp +++ b/selfdrive/ui/ui.hpp @@ -166,6 +166,7 @@ typedef struct UIScene { // for blinker, from kegman bool leftBlinker; bool rightBlinker; + bool brakeLights; int blinker_blinkingrate; } UIScene;