From 22ced0c558a10051c10e3be8d5f47ea6c7fac29c Mon Sep 17 00:00:00 2001 From: Brian Hanson Date: Thu, 16 Apr 2026 22:03:01 -0500 Subject: [PATCH] cleanup: remove dead CarCruiseDisplayActual param Audit of post-fork param additions found CarCruiseDisplayActual was written every CAN cycle (gated) but only consumed by hyundaicanfd.py:: create_buttons_alt, which has `return` on line 1 and no active callers. Write was pure waste. Removed registration, write path, cache field, and the dead read. Also dropped the now-unused `from openpilot.common.params import Params` in hyundaicanfd.py. Co-Authored-By: Claude Opus 4.6 (1M context) --- common/params.cc | 1 - selfdrive/car/hyundai/carstate.py | 7 +------ selfdrive/car/hyundai/hyundaicanfd.py | 5 +---- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/common/params.cc b/common/params.cc index 1f4908a..e77e248 100755 --- a/common/params.cc +++ b/common/params.cc @@ -251,7 +251,6 @@ std::unordered_map keys = { {"CarMake", PERSISTENT}, {"CarModel", PERSISTENT}, - {"CarCruiseDisplayActual", PERSISTENT}, {"CarSpeedLimit", PERSISTENT}, {"CarSpeedLimitWarning", PERSISTENT}, diff --git a/selfdrive/car/hyundai/carstate.py b/selfdrive/car/hyundai/carstate.py index d7ad343..3adca8e 100755 --- a/selfdrive/car/hyundai/carstate.py +++ b/selfdrive/car/hyundai/carstate.py @@ -51,7 +51,6 @@ class CarState(CarStateBase): # CLEARPILOT: cache to avoid per-cycle atomic writes to /dev/shm (eats CPU via fsync/flock) self._prev_car_speed_limit = None self._prev_car_is_metric = None - self._prev_car_cruise_display = None self.cruise_info = {} @@ -223,11 +222,7 @@ class CarState(CarStateBase): if self.is_metric != self._prev_car_is_metric: self.params_memory.put("CarIsMetric", "1" if self.is_metric else "0") self._prev_car_is_metric = self.is_metric - car_cruise_display = cp_cruise.vl["SCC11"]["VSetDis"] - if car_cruise_display != self._prev_car_cruise_display: - self.params_memory.put_float("CarCruiseDisplayActual", car_cruise_display) - self._prev_car_cruise_display = car_cruise_display - + return ret diff --git a/selfdrive/car/hyundai/hyundaicanfd.py b/selfdrive/car/hyundai/hyundaicanfd.py index 9602892..fddcd32 100755 --- a/selfdrive/car/hyundai/hyundaicanfd.py +++ b/selfdrive/car/hyundai/hyundaicanfd.py @@ -2,7 +2,6 @@ from openpilot.common.numpy_fast import clip from openpilot.selfdrive.car import CanBusBase from openpilot.selfdrive.car.hyundai.values import HyundaiFlags -from openpilot.common.params import Params class CanBus(CanBusBase): def __init__(self, CP, hda2=None, fingerprint=None) -> None: @@ -127,9 +126,7 @@ def create_buttons(packer, CP, CAN, cnt, btn): def create_buttons_alt(packer, CP, CAN, cnt, btn, template): return - params_memory = Params("/dev/shm/params") - CarCruiseDisplayActual = params_memory.get_float("CarCruiseDisplayActual") - + values = { "COUNTER": cnt, "NEW_SIGNAL_1": 0.0,