engage on rising edge

pull/22407/head
Willem Melching 4 years ago
parent 06c451a4ed
commit c972956cb4
  1. 14
      selfdrive/car/honda/interface.py

@ -393,16 +393,10 @@ class CarInterface(CarInterfaceBase):
if self.CS.CP.minEnableSpeed > 0 and ret.vEgo < 0.001:
events.add(EventName.manualRestart)
# handle button presses
for b in ret.buttonEvents:
# do enable on both accel and decel buttons
if b.type in [ButtonType.accelCruise, ButtonType.decelCruise] and not b.pressed:
if not self.CP.pcmCruise:
events.add(EventName.buttonEnable)
# do disable on button down
if b.type == ButtonType.cancel and b.pressed:
if self.CS.cruise_buttons in [CruiseButtons.RES_ACCEL, CruiseButtons.DECEL_SET]:
if not self.CP.pcmCruise:
events.add(EventName.buttonEnable)
elif self.CS.cruise_buttons == CruiseButtons.CANCEL:
events.add(EventName.buttonCancel)
ret.events = events.to_msg()

Loading…
Cancel
Save