Skip to content

Commit 550ce96

Browse files
committed
block speed adjustment for enable presses
1 parent 0258b64 commit 550ce96

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

selfdrive/car/cruise.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@ def _update_v_cruise_non_pcm(self, CS, enabled, is_metric):
9292
if button_type == ButtonType.accelCruise and cruise_standstill:
9393
return
9494

95-
# Don't adjust speed if we've enabled since the button was depressed (some ports enable on rising edge)
96-
if not self.button_change_states[button_type]["enabled"] and enabled:
95+
# Don't adjust speed if this button press is intended to enable openpilot
96+
enabled_before_pressing = self.button_change_states[button_type]["enabled"]
97+
if CS.buttonEnable and not enabled_before_pressing:
9798
return
9899

99100
if not self.v_cruise_initialized:

0 commit comments

Comments
 (0)