From 25b1d523143bb29b2b0c8e54de95ffd762a0d326 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Mon, 21 Mar 2022 19:01:40 -0700 Subject: [PATCH] thermald: non-blocking power save configuration --- selfdrive/thermald/thermald.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index ffcefa861..8b54d153e 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -305,7 +305,10 @@ def thermald_thread(end_event, hw_queue): params.put_bool("IsEngaged", False) engaged_prev = False - HARDWARE.set_power_save(not should_start) + + # this can take more than a second + t = threading.Thread(target=HARDWARE.set_power_save, args=(not should_start, )) + t.start() if sm.updated['controlsState']: engaged = sm['controlsState'].enabled