Skip to content

Commit

Permalink
MADS: Hyundai: Skip cruise main button check with pcmCruise (commaa…
Browse files Browse the repository at this point in the history
…i#405)

* MADS: Hyundai: Skip cruise main button check with `pcmCruise`

* 2 modes!
  • Loading branch information
sunnyhaibin authored Aug 12, 2024
1 parent c70db10 commit 6f3e44f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions selfdrive/car/hyundai/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ def _update(self, c):
self.CS.accEnabled = True

if self.enable_mads:
if not self.CS.prev_mads_enabled and self.CS.mads_enabled and \
any(b.type == ButtonType.altButton3 for b in self.CS.button_events):
if not self.CS.prev_mads_enabled and self.CS.mads_enabled and (self.CP.pcmCruise or
(any(b.type == ButtonType.altButton3 for b in self.CS.button_events) and not self.CP.pcmCruise)):
self.CS.madsEnabled = True
if any(b.type == ButtonType.altButton1 and b.pressed for b in self.CS.button_events):
self.CS.madsEnabled = not self.CS.madsEnabled
Expand Down

0 comments on commit 6f3e44f

Please sign in to comment.