From cd4b0b7e7a3e4b9900ea47689b78b606cb5ba24a Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Mon, 29 Mar 2021 12:01:28 +0200 Subject: [PATCH] CPR3 logging only on C2 old-commit-hash: 611446edd4e193025729987e4638d19f89f5d824 --- selfdrive/thermald/thermald.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index ef7e529f4a..776c93f36f 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -193,16 +193,17 @@ def thermald_thread(): thermal_config = HARDWARE.get_thermal_config() # CPR3 logging - base_path = "/sys/kernel/debug/cpr3-regulator/" - cpr_files = [p for p in Path(base_path).glob("**/*") if p.is_file()] - cpr_data = {} - for cf in cpr_files: - with open(cf, "r") as f: - try: - cpr_data[str(cf)] = f.read().strip() - except Exception: - pass - cloudlog.event("CPR", data=cpr_data) + if EON: + base_path = "/sys/kernel/debug/cpr3-regulator/" + cpr_files = [p for p in Path(base_path).glob("**/*") if p.is_file()] + cpr_data = {} + for cf in cpr_files: + with open(cf, "r") as f: + try: + cpr_data[str(cf)] = f.read().strip() + except Exception: + pass + cloudlog.event("CPR", data=cpr_data) while 1: pandaState = messaging.recv_sock(pandaState_sock, wait=True)