not sure if unintended consequences

audible-cancel
Shane Smiskol 1 month ago
parent 9571fc5607
commit 6cb91bbb27
  1. 1
      cereal/log.capnp
  2. 4
      selfdrive/selfdrived/events.py
  3. 3
      selfdrive/selfdrived/selfdrived.py

@ -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: {
ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage),
},
EventName.buttonCancel: {
ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage),
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:

Loading…
Cancel
Save