From a7fe4560a64ce00741f53f9bb5a0de5467b095c8 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Sat, 6 Feb 2021 04:12:33 +0800 Subject: [PATCH] move global SET_SPEED_NA to function that uses it (#20026) --- selfdrive/ui/paint.cc | 1 + selfdrive/ui/ui.hpp | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/selfdrive/ui/paint.cc b/selfdrive/ui/paint.cc index 21fe6d383..3b1a17e6c 100644 --- a/selfdrive/ui/paint.cc +++ b/selfdrive/ui/paint.cc @@ -214,6 +214,7 @@ static void ui_draw_world(UIState *s) { } static void ui_draw_vision_maxspeed(UIState *s) { + const int SET_SPEED_NA = 255; float maxspeed = s->scene.controls_state.getVCruise(); const bool is_cruise_set = maxspeed != 0 && maxspeed != SET_SPEED_NA; if (is_cruise_set && !s->is_metric) { maxspeed *= 0.6225; } diff --git a/selfdrive/ui/ui.hpp b/selfdrive/ui/ui.hpp index 189fec52a..73dd7e1da 100644 --- a/selfdrive/ui/ui.hpp +++ b/selfdrive/ui/ui.hpp @@ -61,8 +61,6 @@ const int UI_FREQ = 20; // Hz const int MODEL_PATH_MAX_VERTICES_CNT = TRAJECTORY_SIZE*2; const int TRACK_POINTS_MAX_CNT = TRAJECTORY_SIZE*4; -const int SET_SPEED_NA = 255; - typedef enum NetStatus { NET_CONNECTED, NET_DISCONNECTED,