then we can revert this

pull/25393/head
Shane Smiskol 3 years ago
parent 0e5be53bbe
commit ddf7aa0e42
  1. 4
      selfdrive/car/__init__.py
  2. 2
      selfdrive/car/gm/interface.py

@ -24,12 +24,12 @@ def create_button_event(cur_but: int, prev_but: int, buttons_dict: Dict[int, cap
return be 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 = [] events = []
for b in buttonEvents: for b in buttonEvents:
# do enable on both accel and decel buttons # do enable on both accel and decel buttons
if not pcm_cruise: 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) events.append(EventName.buttonEnable)
# do disable on button down # do disable on button down
if b.type == ButtonType.cancel and b.pressed: if b.type == ButtonType.cancel and b.pressed:

@ -183,7 +183,7 @@ class CarInterface(CarInterfaceBase):
events.add(car.CarEvent.EventName.resumeBlocked) events.add(car.CarEvent.EventName.resumeBlocked)
# handle button presses # 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() ret.events = events.to_msg()

Loading…
Cancel
Save