From 6ad719796ceb04e0bd2d75768ca1261718ab6f0b Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Mon, 16 Feb 2026 02:06:26 -0500 Subject: [PATCH] fix race condition --- selfdrive/car/cruise.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/cruise.py b/selfdrive/car/cruise.py index 55ab476550..572dfabc02 100644 --- a/selfdrive/car/cruise.py +++ b/selfdrive/car/cruise.py @@ -49,8 +49,6 @@ class VCruiseHelper(VCruiseHelperSP): self.get_minimum_set_speed(is_metric) _enabled = self.update_enabled_state(CS, enabled) - if not self.CP.pcmCruise or not self.CP_SP.pcmCruiseSpeed: - self.update_button_timers(CS, enabled) if CS.cruiseState.available: if not self.CP.pcmCruise or (not self.CP_SP.pcmCruiseSpeed and _enabled): @@ -71,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