diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index f0d9eb98..632d1a6c 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -433,6 +433,7 @@ void ui_update_frogpilot_params(UIState *s, Params ¶ms) { scene.hide_alerts = hide_ui_elements && params.getBool("HideAlerts"); scene.hide_map_icon = hide_ui_elements && params.getBool("HideMapIcon"); scene.hide_max_speed = hide_ui_elements && params.getBool("HideMaxSpeed"); + scene.screen_brightness = screen_management ? params.getInt("ScreenBrightness") : 101; scene.speed_limit_controller = scene.longitudinal_control && params.getBool("SpeedLimitController"); scene.show_slc_offset = scene.speed_limit_controller && params.getBool("ShowSLCOffset"); @@ -602,6 +603,8 @@ void Device::updateBrightness(const UIState &s) { int brightness = brightness_filter.update(clipped_brightness); if (!awake) { brightness = 0; + } else if (s.scene.screen_brightness != 101) { + brightness = s.scene.screen_brightness; } if (brightness != last_brightness) { diff --git a/selfdrive/ui/ui.h b/selfdrive/ui/ui.h index e69a0ccb..b7cb7ecd 100644 --- a/selfdrive/ui/ui.h +++ b/selfdrive/ui/ui.h @@ -248,6 +248,7 @@ typedef struct UIScene { int model_length; int obstacle_distance; int obstacle_distance_stock; + int screen_brightness; int started_timer; int steering_angle_deg; int stopped_equivalence;