diff --git a/cereal b/cereal index 85e1e2f79c..cde8667d3b 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit 85e1e2f79cffc4df307e29b118a76adc4226b52f +Subproject commit cde8667d3bacb71d324b06b3d803c8fd7c59d2db diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index 337da6db81..ba214410db 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -13,14 +13,17 @@ from cereal import car EventName = car.CarEvent.EventName -def get_startup_event(car_recognized, controller_available, fuzzy_fingerprint): +def get_startup_event(car_recognized, controller_available, fuzzy_fingerprint, fw_seen): if comma_remote and tested_branch: event = EventName.startup else: event = EventName.startupMaster if not car_recognized: - event = EventName.startupNoCar + if fw_seen: + event = EventName.startupNoCar + else: + event = EventName.startupNoFw elif car_recognized and not controller_available: event = EventName.startupNoControl elif car_recognized and fuzzy_fingerprint: diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 21ecc47a72..6608ce3c2e 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -145,7 +145,8 @@ class Controls: # TODO: no longer necessary, aside from process replay self.sm['liveParameters'].valid = True - self.startup_event = get_startup_event(car_recognized, controller_available, self.CP.fuzzyFingerprint) + self.startup_event = get_startup_event(car_recognized, controller_available, self.CP.fuzzyFingerprint, + len(self.CP.carFw) > 0) if not sounds_available: self.events.add(EventName.soundsUnavailable, static=True) diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index b1e0042e1e..62e9dab769 100644 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -268,6 +268,14 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo ET.PERMANENT: startup_fuzzy_fingerprint_alert, }, + EventName.startupNoFw: { + ET.PERMANENT: Alert( + "Car Unrecognized", + "Check All Connections", + AlertStatus.userPrompt, AlertSize.mid, + Priority.LOWER, VisualAlert.none, AudibleAlert.none, 0., 0., 15.), + }, + EventName.dashcamMode: { ET.PERMANENT: Alert( "Dashcam Mode", diff --git a/selfdrive/controls/tests/test_startup.py b/selfdrive/controls/tests/test_startup.py index 4780ca777e..5c63755467 100755 --- a/selfdrive/controls/tests/test_startup.py +++ b/selfdrive/controls/tests/test_startup.py @@ -58,9 +58,13 @@ class TestStartup(unittest.TestCase): (EventName.startupNoControl, MAZDA.CX5, True, CX5_FW_VERSIONS), (EventName.startupNoControl, MAZDA.CX5, False, CX5_FW_VERSIONS), + # unrecognized car with no fw + (EventName.startupNoFw, None, True, None), + (EventName.startupNoFw, None, False, None), + # unrecognized car - (EventName.startupNoCar, None, True, None), - (EventName.startupNoCar, None, False, None), + (EventName.startupNoCar, None, True, COROLLA_FW_VERSIONS[:1]), + (EventName.startupNoCar, None, False, COROLLA_FW_VERSIONS[:1]), # fuzzy match (EventName.startupFuzzyFingerprint, TOYOTA.COROLLA, True, COROLLA_FW_VERSIONS_FUZZY),