From 6f3e44f76e05418ece5c1e4019571e62579ac403 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sun, 11 Aug 2024 19:21:31 -0800 Subject: [PATCH] MADS: Hyundai: Skip cruise main button check with `pcmCruise` (#405) * MADS: Hyundai: Skip cruise main button check with `pcmCruise` * 2 modes! --- selfdrive/car/hyundai/interface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/hyundai/interface.py b/selfdrive/car/hyundai/interface.py index c2140d2925b16a..7db3dd9e41e09c 100644 --- a/selfdrive/car/hyundai/interface.py +++ b/selfdrive/car/hyundai/interface.py @@ -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