diff --git a/selfdrive/thermald.py b/selfdrive/thermald.py index ace8ffc56..297b80ac6 100755 --- a/selfdrive/thermald.py +++ b/selfdrive/thermald.py @@ -11,6 +11,7 @@ from common.params import Params from common.realtime import sec_since_boot from common.numpy_fast import clip from common.filter_simple import FirstOrderFilter +params = Params() ThermalStatus = log.ThermalData.ThermalStatus CURRENT_TAU = 15. # 15s time constant @@ -82,7 +83,7 @@ _TEMP_THRS_L = [42.5, 57.5, 72.5, 10000] _FAN_SPEEDS = [0, 16384, 32768, 65535] # max fan speed only allowed if battery is hot _BAT_TEMP_THERSHOLD = 45. -if Params.get('DragonNoctuaMode') == "1": +if params.get('DragonNoctuaMode') == "1": _FAN_SPEEDS = [65535, 65535, 65535, 65535] _BAT_TEMP_THERSHOLD = 20. @@ -149,8 +150,6 @@ def thermald_thread(): charging_disabled = False os.system('echo "1" > /sys/class/power_supply/battery/charging_enabled') - params = Params() - while 1: health = messaging.recv_sock(health_sock, wait=True) location = messaging.recv_sock(location_sock)