From 367aec54d1c4c5ed8d3f651d0b2f8b80fb0ac0e5 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 25 Mar 2021 21:37:38 -0700 Subject: [PATCH] show persistent dashcam mode alert (#20483) * always show dashcam mode alert * show persistent dashcam mode alert * lowest Co-authored-by: Comma Device --- cereal | 2 +- selfdrive/controls/controlsd.py | 2 ++ selfdrive/controls/lib/events.py | 10 +++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cereal b/cereal index 38ecbfe0..e1741865 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit 38ecbfe03b4b3cdc984c6358a58df2b471aea968 +Subproject commit e1741865f8117f27206b0225b4c48fa7432b830f diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 4ede231f..9b37834b 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -144,6 +144,8 @@ class Controls: self.events.add(EventName.communityFeatureDisallowed, static=True) if not car_recognized: self.events.add(EventName.carUnrecognized, static=True) + elif self.read_only: + self.events.add(EventName.dashcamMode, 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 470d76be..12fd6519 100644 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -253,12 +253,12 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo Priority.LOWER, VisualAlert.none, AudibleAlert.none, 0., 0., 15.), }, - EventName.startupOneplus: { + EventName.dashcamMode: { ET.PERMANENT: Alert( - "WARNING: Original EON deprecated", - "Device will no longer update", - AlertStatus.userPrompt, AlertSize.mid, - Priority.LOWER, VisualAlert.none, AudibleAlert.none, 0., 0., 15.), + "Dashcam Mode", + "", + AlertStatus.normal, AlertSize.small, + Priority.LOWEST, VisualAlert.none, AudibleAlert.none, 0., 0., .2), }, EventName.invalidLkasSetting: {