From 1984a72cc8680b23c202695b8aeeb1aa28f7160c Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 25 Aug 2023 16:09:15 -0700 Subject: [PATCH] can also do this --- selfdrive/car/interfaces.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/selfdrive/car/interfaces.py b/selfdrive/car/interfaces.py index 53b3e381f6..1b9502d048 100644 --- a/selfdrive/car/interfaces.py +++ b/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: