Play disengage chime when booting while engaged (#34884)

This commit is contained in:
Shane Smiskol
2026-11-28 11:58:37 -06:00
committed by firestar5683
parent a02f665e45
commit 23640c4a36
3 changed files with 13 additions and 0 deletions
+1
View File
@@ -100,6 +100,7 @@ struct OnroadEvent @0xc4fa6047f024e718 {
startupNoControl @62;
startupNoSecOcKey @63;
startupMaster @64;
startupCruiseCanceled @105;
fcw @65;
steerSaturated @66;
belowEngageSpeed @67;
+6
View File
@@ -695,6 +695,12 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage),
},
EventName.startupCruiseCanceled: {
ET.PERMANENT: Alert("Cruise Canceled", "Cruise was on at startup",
AlertStatus.normal, AlertSize.mid,
Priority.MID, VisualAlert.none, AudibleAlert.disengage, 3.),
},
EventName.buttonCancel: {
ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage),
ET.NO_ENTRY: NoEntryAlert("Cancel Pressed"),
@@ -254,6 +254,7 @@ class SelfdriveD:
self.requested_experimental_mode = False
self.personality = self.params.get("LongitudinalPersonality", return_default=True)
self.recalibrating_seen = False
self.startup_cruise_checked = False
self.dm_lockout_set = False
self.dm_uncertain_alerted = False
self.state_machine = StateMachine()
@@ -482,6 +483,11 @@ class SelfdriveD:
set_offroad_alert("Offroad_DriverMonitoringUncertain", True)
self.dm_uncertain_alerted = True
if not getattr(self, "startup_cruise_checked", False) and CS.canValid and not CS.canTimeout:
self.startup_cruise_checked = True
if CS.cruiseState.enabled and not CS.accFaulted and not self.events.contains(ET.ENABLE) and not REPLAY:
self.events.add(EventName.startupCruiseCanceled)
# Create events for temperature, disk space, and memory
if self.sm['deviceState'].thermalStatus >= ThermalStatus.overheated:
self.events.add(EventName.overheat)