mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-21 09:13:46 +08:00
silent park brake
This commit is contained in:
@@ -197,6 +197,7 @@ struct OnroadEvent @0xc4fa6047f024e718 {
|
||||
silentReverseGear @160;
|
||||
silentDoorOpen @161;
|
||||
silentSeatbeltNotLatched @162;
|
||||
silentParkBrake @163;
|
||||
|
||||
soundsUnavailableDEPRECATED @47;
|
||||
}
|
||||
|
||||
@@ -1054,6 +1054,15 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
|
||||
ET.NO_ENTRY: NoEntryAlert("Seatbelt Unlatched"),
|
||||
},
|
||||
|
||||
EventName.silentParkBrake: {
|
||||
ET.WARNING: Alert(
|
||||
"",
|
||||
"",
|
||||
AlertStatus.normal, AlertSize.mid,
|
||||
Priority.LOW, VisualAlert.none, AudibleAlert.none, 0.),
|
||||
ET.NO_ENTRY: NoEntryAlert("Parking Brake Engaged"),
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -60,6 +60,9 @@ class ModularAssistiveDrivingSystem:
|
||||
if self.events.has(EventName.seatbeltNotLatched):
|
||||
self.events.replace(EventName.seatbeltNotLatched, EventName.silentSeatbeltNotLatched)
|
||||
transition_paused_state()
|
||||
if self.events.has(EventName.parkBrake):
|
||||
self.events.replace(EventName.parkBrake, EventName.silentParkBrake)
|
||||
transition_paused_state()
|
||||
|
||||
if self.disengage_lateral_on_brake_toggle:
|
||||
if self.events.has(EventName.pedalPressed):
|
||||
|
||||
@@ -10,9 +10,10 @@ ACTIVE_STATES = (State.enabled, State.softDisabling, State.overriding)
|
||||
ENABLED_STATES = (State.paused, *ACTIVE_STATES)
|
||||
|
||||
GEARS_ALLOW_PAUSED_SILENT = [EventName.silentWrongGear, EventName.silentReverseGear, EventName.silentBrakeHold,
|
||||
EventName.silentDoorOpen, EventName.silentSeatbeltNotLatched]
|
||||
EventName.silentDoorOpen, EventName.silentSeatbeltNotLatched, EventName.parkBrake]
|
||||
GEARS_ALLOW_PAUSED = [EventName.wrongGear, EventName.reverseGear, EventName.brakeHold,
|
||||
EventName.doorOpen, EventName.seatbeltNotLatched, *GEARS_ALLOW_PAUSED_SILENT]
|
||||
EventName.doorOpen, EventName.seatbeltNotLatched, EventName.silentParkBrake,
|
||||
*GEARS_ALLOW_PAUSED_SILENT]
|
||||
|
||||
|
||||
class StateMachine:
|
||||
|
||||
Reference in New Issue
Block a user