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

pull/23529/head
Willem Melching 2022-01-14 14:06:21 +01:00 committed by GitHub
parent ef3a549fac
commit e72eb1d472
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 8 deletions

View File

@ -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))