@ -58,6 +58,7 @@ struct OnroadEvent @0xc4fa6047f024e718 {
controlsMismatch @22;
pcmEnable @23;
pcmDisable @24;
cancellingCruise @24;
radarFault @25;
radarTempUnavailable @93;
brakeHold @26;
@ -646,6 +646,10 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage),
},
EventName.cancellingCruise: {
EventName.buttonCancel: {
ET.NO_ENTRY: NoEntryAlert("Cancel Pressed"),
@ -158,6 +158,9 @@ class SelfdriveD:
if self.CP.passive:
return
if self.sm['carControl'].cruiseControl.cancel:
self.events.add(EventName.cancellingCruise)
# Block resume if cruise never previously enabled
resume_pressed = any(be.type in (ButtonType.accelCruise, ButtonType.resumeCruise) for be in CS.buttonEvents)
if not self.CP.pcmCruise and CS.vCruise > 250 and resume_pressed: