From ddf7aa0e424193697a2bc0d19e9ab40cef33a88b Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 9 Aug 2022 17:37:40 -0700 Subject: [PATCH] then we can revert this --- selfdrive/car/__init__.py | 4 ++-- selfdrive/car/gm/interface.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/selfdrive/car/__init__.py b/selfdrive/car/__init__.py index 518909cb54..c77e40daaf 100644 --- a/selfdrive/car/__init__.py +++ b/selfdrive/car/__init__.py @@ -24,12 +24,12 @@ def create_button_event(cur_but: int, prev_but: int, buttons_dict: Dict[int, cap return be -def create_button_enable_events(buttonEvents: capnp.lib.capnp._DynamicListBuilder, pcm_cruise: bool = False, resume_enabled: bool = True) -> List[int]: +def create_button_enable_events(buttonEvents: capnp.lib.capnp._DynamicListBuilder, pcm_cruise: bool = False) -> List[int]: events = [] for b in buttonEvents: # do enable on both accel and decel buttons if not pcm_cruise: - if (b.type == ButtonType.decelCruise or (b.type == ButtonType.accelCruise and resume_enabled)) and not b.pressed: + if b.type in (ButtonType.accelCruise, ButtonType.decelCruise) and not b.pressed: events.append(EventName.buttonEnable) # do disable on button down if b.type == ButtonType.cancel and b.pressed: diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index 8ad54ef18a..7963df086c 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -183,7 +183,7 @@ class CarInterface(CarInterfaceBase): events.add(car.CarEvent.EventName.resumeBlocked) # handle button presses - events.events.extend(create_button_enable_events(ret.buttonEvents, pcm_cruise=self.CP.pcmCruise, resume_enabled=True)) + events.events.extend(create_button_enable_events(ret.buttonEvents, pcm_cruise=self.CP.pcmCruise)) ret.events = events.to_msg()