MADS: Only allow altButton1 trigger if enabled

This commit is contained in:
Jason Wen
2023-12-26 02:00:59 +00:00
parent 519a3bf52c
commit 71adace06f
+1 -1
View File
@@ -690,7 +690,7 @@ class CarInterfaceBase(ABC):
self.cruise_cancelled_btn = True
events.add(EventName.manualLongitudinalRequired)
# do disable on MADS button if ACC is disabled
if b.type == ButtonType.altButton1 and b.pressed:
if b.type == ButtonType.altButton1 and b.pressed and self.enable_mads:
if not cs_out.madsEnabled: # disabled MADS
if not cs_out.cruiseState.enabled:
events.add(EventName.buttonCancel)