Honda: fix enabling before PCM (#24715)
* Don't enable for pcmCruise Honda * make it a no entry as well * do in another PR old-commit-hash: 40deea7d7bdd2176f897c203657e45bfd7fd1fcc
This commit is contained in:
@@ -24,12 +24,13 @@ 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) -> 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 b.type in (ButtonType.accelCruise, ButtonType.decelCruise) and not b.pressed:
|
||||
events.append(EventName.buttonEnable)
|
||||
if not pcm_cruise:
|
||||
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:
|
||||
events.append(EventName.buttonCancel)
|
||||
|
||||
@@ -367,7 +367,7 @@ class CarInterface(CarInterfaceBase):
|
||||
events.add(EventName.manualRestart)
|
||||
|
||||
# handle button presses
|
||||
events.events.extend(create_button_enable_events(ret.buttonEvents))
|
||||
events.events.extend(create_button_enable_events(ret.buttonEvents, self.CP.pcmCruise))
|
||||
|
||||
ret.events = events.to_msg()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user