diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index 9052ebb26b..434ed1ef1b 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -8,10 +8,12 @@ from selfdrive.swaglog import cloudlog import cereal.messaging as messaging from selfdrive.car import gen_empty_fingerprint -from cereal import car +from cereal import car, log EventName = car.CarEvent.EventName +HwType = log.HealthData.HwType -def get_startup_event(car_recognized, controller_available): + +def get_startup_event(car_recognized, controller_available, hw_type): event = EventName.startup if Params().get("GitRemote", encoding="utf8") in ['git@github.com:commaai/openpilot.git', 'https://github.com/commaai/openpilot.git']: if Params().get("GitBranch", encoding="utf8") not in ['devel', 'release2-staging', 'dashcam-staging', 'release2', 'dashcam']: @@ -20,6 +22,8 @@ def get_startup_event(car_recognized, controller_available): event = EventName.startupNoCar elif car_recognized and not controller_available: event = EventName.startupNoControl + elif hw_type == HwType.whitePanda: + event = EventName.startupWhitePanda return event diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index c85db56713..e529054013 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -130,7 +130,7 @@ class Controls: self.sm['dMonitoringState'].awarenessStatus = 1. self.sm['dMonitoringState'].faceDetected = False - self.startup_event = get_startup_event(car_recognized, controller_available) + self.startup_event = get_startup_event(car_recognized, controller_available, hw_type) if not sounds_available: self.events.add(EventName.soundsUnavailable, static=True) @@ -140,6 +140,8 @@ class Controls: self.events.add(EventName.communityFeatureDisallowed, static=True) if self.read_only and not passive: self.events.add(EventName.carUnrecognized, static=True) + # if hw_type == HwType.whitePanda: + # self.events.add(EventName.whitePandaUnsupported, static=True) # controlsd is driven by can recv, expected at 100Hz self.rk = Ratekeeper(100, print_delay_threshold=None) diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index d2427866f3..78ccd2575d 100644 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -198,6 +198,14 @@ EVENTS = { Priority.LOWER, VisualAlert.none, AudibleAlert.none, 0., 0., 15.), }, + EventName.startupWhitePanda: { + ET.PERMANENT: Alert( + "WARNING: White panda is deprecated", + "Upgrade to comma two or black panda", + AlertStatus.userPrompt, AlertSize.mid, + Priority.LOWER, VisualAlert.none, AudibleAlert.none, 0., 0., 15.), + }, + EventName.startupMaster: { ET.PERMANENT: Alert( "WARNING: This branch is not tested", @@ -230,6 +238,15 @@ EVENTS = { Priority.LOWER, VisualAlert.none, AudibleAlert.none, 0., 0., .2), }, + EventName.whitePandaUnsupported: { + ET.PERMANENT: Alert( + "White Panda Is No Longer Supported", + "Upgrade to comma two or black panda", + AlertStatus.normal, AlertSize.mid, + Priority.LOWER, VisualAlert.none, AudibleAlert.none, 0., 0., .2), + ET.NO_ENTRY: NoEntryAlert("White panda is no longer supported"), + }, + EventName.invalidLkasSetting: { ET.PERMANENT: Alert( "Stock LKAS is turned on",