diff --git a/selfdrive/car/ford/interface.py b/selfdrive/car/ford/interface.py index 1ae57965e7..9bf197f893 100644 --- a/selfdrive/car/ford/interface.py +++ b/selfdrive/car/ford/interface.py @@ -45,11 +45,13 @@ class CarInterface(CarInterfaceBase): pscm_config = next((fw for fw in car_fw if fw.ecu == Ecu.eps and b'\x22\xDE\x01' in fw.request), None) if pscm_config: if len(pscm_config.response) != 24: + ret.flags |= FordFlags.LKAS_UNAVAILABLE ret.dashcamOnly = True else: config_tja = pscm_config.response[7] # Traffic Jam Assist config_lca = pscm_config.response[8] # Lane Centering Assist if config_tja != 0xFF or config_lca != 0xFF: + ret.flags |= FordFlags.LKAS_UNAVAILABLE ret.dashcamOnly = True # Auto Transmission: 0x732 ECU or Gear_Shift_by_Wire_FD1 @@ -79,6 +81,8 @@ class CarInterface(CarInterfaceBase): events = self.create_common_events(ret, extra_gears=[GearShifter.manumatic]) if not self.CS.vehicle_sensors_valid: events.add(car.CarEvent.EventName.vehicleSensorsInvalid) + elif self.CP.flags & FordFlags.LKAS_UNAVAILABLE: + events.add(car.CarEvent.EventName.actuatorsApiUnavailable) ret.events = events.to_msg() diff --git a/selfdrive/car/ford/values.py b/selfdrive/car/ford/values.py index b1868bfa9b..0cad383b1a 100644 --- a/selfdrive/car/ford/values.py +++ b/selfdrive/car/ford/values.py @@ -44,6 +44,8 @@ class CarControllerParams: class FordFlags(IntFlag): # Static flags CANFD = 1 + # Dynamic flags + LKAS_UNAVAILABLE = 2 class RADAR: diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index 40796dd8ff..de3e5e7182 100755 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -950,6 +950,11 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { ET.NO_ENTRY: NoEntryAlert("Vehicle Sensors Calibrating"), }, + EventName.actuatorsApiUnavailable: { + ET.PERMANENT: NormalPermanentAlert("Missing Actuators API", "Your car may not be supported"), + ET.NO_ENTRY: NoEntryAlert("Missing Actuators API", "Your car may not be supported"), + }, + }