thermald: remove brightness setting on ui crash (#23527)

old-commit-hash: e72eb1d472
commatwo_master
Willem Melching 3 years ago committed by GitHub
parent 0e06079700
commit f6ba27a1ea
  1. 9
      selfdrive/thermald/thermald.py

@ -159,7 +159,7 @@ def thermald_thread() -> NoReturn:
pandaState_timeout = int(1000 * 2.5 * DT_TRML) # 2.5x the expected pandaState frequency
pandaState_sock = messaging.sub_sock('pandaStates', timeout=pandaState_timeout)
sm = messaging.SubMaster(["peripheralState", "gpsLocationExternal", "managerState", "controlsState"])
sm = messaging.SubMaster(["peripheralState", "gpsLocationExternal", "controlsState"])
fan_speed = 0
count = 0
@ -190,7 +190,6 @@ def thermald_thread() -> NoReturn:
in_car = False
handle_fan = None
is_uno = False
ui_running_prev = False
engaged_prev = False
params = Params()
@ -396,12 +395,6 @@ def thermald_thread() -> NoReturn:
time.sleep(10)
HARDWARE.shutdown()
# If UI has crashed, set the brightness to reasonable non-zero value
ui_running = "ui" in (p.name for p in sm["managerState"].processes if p.running)
if ui_running_prev and not ui_running:
HARDWARE.set_screen_brightness(20)
ui_running_prev = ui_running
msg.deviceState.chargingError = current_filter.x > 0. and msg.deviceState.batteryPercent < 90 # if current is positive, then battery is being discharged
msg.deviceState.started = started_ts is not None
msg.deviceState.startedMonoTime = int(1e9*(started_ts or 0))

Loading…
Cancel
Save