hw: add fan intake and exhaust temps (#34156)

* hw: add fan intake and exhaust temps

* remove bat

---------

Co-authored-by: Comma Device <device@comma.ai>
pull/34158/head
Adeeb Shihadeh 5 months ago committed by GitHub
parent c6e4241bad
commit 34d62836fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      cereal/log.capnp
  2. 2
      system/hardware/base.py
  3. 2
      system/hardware/hardwared.py
  4. 2
      system/hardware/pc/hardware.py
  5. 9
      system/hardware/tici/hardware.py

@ -486,6 +486,8 @@ struct DeviceState @0xa4d8b5af2aa492eb {
nvmeTempC @35 :List(Float32);
modemTempC @36 :List(Float32);
pmicTempC @39 :List(Float32);
intakeTempC @46 :Float32;
exhaustTempC @47 :Float32;
maxTempC @44 :Float32; # max of other temps, used to control fan
thermalZones @38 :List(ThermalZone);
thermalStatus @14 :ThermalStatus;

@ -3,7 +3,7 @@ from collections import namedtuple
from cereal import log
ThermalConfig = namedtuple('ThermalConfig', ['cpu', 'gpu', 'mem', 'bat', 'pmic'])
ThermalConfig = namedtuple('ThermalConfig', ['cpu', 'gpu', 'mem', 'pmic', 'intake', 'exhaust'])
NetworkType = log.DeviceState.NetworkType

@ -83,6 +83,8 @@ def read_thermal(thermal_config):
dat.deviceState.gpuTempC = [read_tz(z) / thermal_config.gpu[1] for z in thermal_config.gpu[0]]
dat.deviceState.memoryTempC = read_tz(thermal_config.mem[0]) / thermal_config.mem[1]
dat.deviceState.pmicTempC = [read_tz(z) / thermal_config.pmic[1] for z in thermal_config.pmic[0]]
dat.deviceState.intakeTempC = read_tz(thermal_config.intake[0]) / thermal_config.intake[1]
dat.deviceState.exhaustTempC = read_tz(thermal_config.exhaust[0]) / thermal_config.exhaust[1]
return dat

@ -54,7 +54,7 @@ class Pc(HardwareBase):
print("SHUTDOWN!")
def get_thermal_config(self):
return ThermalConfig(cpu=((None,), 1), gpu=((None,), 1), mem=(None, 1), bat=(None, 1), pmic=((None,), 1))
return ThermalConfig(cpu=((None,), 1), gpu=((None,), 1), mem=(None, 1), pmic=((None,), 1), intake=(None, 1), exhaust=(None, 1))
def set_screen_brightness(self, percentage):
pass

@ -323,12 +323,17 @@ class Tici(HardwareBase):
os.system("sudo poweroff")
def get_thermal_config(self):
intake, exhaust = (None, 1), (None, 1)
if self.get_device_type() == "mici":
intake = ("intake", 1000)
exhaust = ("exhaust", 1000)
return ThermalConfig(cpu=([f"cpu{i}-silver-usr" for i in range(4)] +
[f"cpu{i}-gold-usr" for i in range(4)], 1000),
gpu=(("gpu0-usr", "gpu1-usr"), 1000),
mem=("ddr-usr", 1000),
bat=(None, 1),
pmic=(("pm8998_tz", "pm8005_tz"), 1000))
pmic=(("pm8998_tz", "pm8005_tz"), 1000),
intake=intake,
exhaust=exhaust)
def set_screen_brightness(self, percentage):
try:

Loading…
Cancel
Save