CarState: add low speed alert field (#33712)

* clean up mazda steer speed alert

* bump
This commit is contained in:
Shane Smiskol
2024-10-02 15:10:33 -07:00
committed by GitHub
parent 2b486b15c6
commit 6f0927011c
3 changed files with 5 additions and 8 deletions
+1
View File
@@ -207,6 +207,7 @@ struct CarState {
carFaultedNonCritical @47 :Bool; # some ECU is faulted, but car remains controllable
espActive @51 :Bool;
vehicleSensorsInvalid @52 :Bool; # invalid steering angle readings, etc.
lowSpeedAlert @56 :Bool; # lost steering control due to a dynamic min steering speed
# cruise state
cruiseState @10 :CruiseState;
+3 -7
View File
@@ -45,7 +45,7 @@ class CarSpecificEvents:
if self.CP.carName in ('body', 'mock'):
events = Events()
elif self.CP.carName == 'subaru':
elif self.CP.carName in ('subaru', 'mazda'):
events = self.create_common_events(CS.out, CS_prev)
elif self.CP.carName == 'ford':
@@ -54,12 +54,6 @@ class CarSpecificEvents:
elif self.CP.carName == 'nissan':
events = self.create_common_events(CS.out, CS_prev, extra_gears=[GearShifter.brake])
elif self.CP.carName == 'mazda':
events = self.create_common_events(CS.out, CS_prev)
if CS.low_speed_alert: # type: ignore[attr-defined]
events.add(EventName.belowSteerSpeed)
elif self.CP.carName == 'chrysler':
events = self.create_common_events(CS.out, CS_prev, extra_gears=[GearShifter.low])
@@ -212,6 +206,8 @@ class CarSpecificEvents:
events.add(EventName.vehicleSensorsInvalid)
if CS.invalidLkasSetting:
events.add(EventName.invalidLkasSetting)
if CS.lowSpeedAlert:
events.add(EventName.belowSteerSpeed)
# Handle button presses
for b in CS.buttonEvents: