can also do this

pull/26463/head
Shane Smiskol 2 years ago
parent e3a10fd327
commit 1984a72cc8
  1. 3
      selfdrive/car/interfaces.py

@ -266,9 +266,10 @@ class CarInterfaceBase(ABC):
events.add(EventName.steerOverride)
# Handle button presses
enable_button_presses = len([b for b in cs_out.buttonEvents if b.type in enable_buttons])
for b in cs_out.buttonEvents:
# Enable OP long on falling edge of enable buttons (defaults to accelCruise and decelCruise, overridable per-port)
if not self.CP.pcmCruise and (b.type in enable_buttons and not b.pressed):
if not self.CP.pcmCruise and (b.type in enable_buttons and not b.pressed) and enable_button_presses == 1:
events.add(EventName.buttonEnable)
# Disable on rising and falling edge of cancel for both stock and OP long
if b.type == ButtonType.cancel:

Loading…
Cancel
Save