From c48b724de1e3f44e0eaea43b1c2cf79c9b5ece1e Mon Sep 17 00:00:00 2001 From: James Mikesell Date: Tue, 24 Feb 2026 02:38:19 -0500 Subject: [PATCH] ICBM: ensure button timers update on disable to clear stale presses (#1688) * ICBM: ensure button timers update on disable to clear stale presses * fix race condition --------- Co-authored-by: Jason Wen --- selfdrive/car/cruise.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/cruise.py b/selfdrive/car/cruise.py index 9973862b8..572dfabc0 100644 --- a/selfdrive/car/cruise.py +++ b/selfdrive/car/cruise.py @@ -48,14 +48,14 @@ class VCruiseHelper(VCruiseHelperSP): self.get_minimum_set_speed(is_metric) + _enabled = self.update_enabled_state(CS, enabled) + if CS.cruiseState.available: - _enabled = self.update_enabled_state(CS, enabled) if not self.CP.pcmCruise or (not self.CP_SP.pcmCruiseSpeed and _enabled): # if stock cruise is completely disabled, then we can use our own set speed logic self._update_v_cruise_non_pcm(CS, _enabled, is_metric) self.update_speed_limit_assist_v_cruise_non_pcm() self.v_cruise_cluster_kph = self.v_cruise_kph - self.update_button_timers(CS, enabled) else: self.v_cruise_kph = CS.cruiseState.speed * CV.MS_TO_KPH self.v_cruise_cluster_kph = CS.cruiseState.speedCluster * CV.MS_TO_KPH @@ -69,6 +69,9 @@ class VCruiseHelper(VCruiseHelperSP): self.v_cruise_kph = V_CRUISE_UNSET self.v_cruise_cluster_kph = V_CRUISE_UNSET + if not self.CP.pcmCruise or not self.CP_SP.pcmCruiseSpeed: + self.update_button_timers(CS, enabled) + def _update_v_cruise_non_pcm(self, CS, enabled, is_metric): # handle button presses. TODO: this should be in state_control, but a decelCruise press # would have the effect of both enabling and changing speed is checked after the state transition