diff --git a/cereal/custom.capnp b/cereal/custom.capnp index 37346c8a2a..230c40d054 100644 --- a/cereal/custom.capnp +++ b/cereal/custom.capnp @@ -267,8 +267,8 @@ struct OnroadEventSP @0xda96579883444c35 { laneTurnRight @18; speedLimitPreActive @19; speedLimitActive @20; - speedLimitConfirmed @21; - speedLimitChanged @22; + speedLimitChanged @21; + speedLimitPending @22; } } diff --git a/sunnypilot/selfdrive/controls/lib/speed_limit/speed_limit_assist.py b/sunnypilot/selfdrive/controls/lib/speed_limit/speed_limit_assist.py index 41508be9aa..3fc56244b2 100644 --- a/sunnypilot/selfdrive/controls/lib/speed_limit/speed_limit_assist.py +++ b/sunnypilot/selfdrive/controls/lib/speed_limit/speed_limit_assist.py @@ -223,7 +223,10 @@ class SpeedLimitAssist: events_sp.add(EventNameSP.speedLimitPreActive) elif self.is_active: if self._state_prev not in ACTIVE_STATES: - events_sp.add(EventNameSP.speedLimitActive) + if self._speed_limit > 0: + events_sp.add(EventNameSP.speedLimitActive) + else: + events_sp.add(EventNameSP.speedLimitPending) elif self.speed_limit_changed and self._speed_limit > 0: if self.speed_limit_prev <= 0: events_sp.add(EventNameSP.speedLimitActive) diff --git a/sunnypilot/selfdrive/selfdrived/events.py b/sunnypilot/selfdrive/selfdrived/events.py index 1549fcdce3..47ea59a86c 100644 --- a/sunnypilot/selfdrive/selfdrived/events.py +++ b/sunnypilot/selfdrive/selfdrived/events.py @@ -186,4 +186,12 @@ EVENTS_SP: dict[int, dict[str, Alert | AlertCallbackType]] = { AlertStatus.normal, AlertSize.mid, Priority.LOW, VisualAlert.none, AudibleAlert.none, 5.), }, + + EventNameSP.speedLimitPending: { + ET.WARNING: Alert( + "Automatically adjusting to the previous speed limit", + "", + AlertStatus.normal, AlertSize.small, + Priority.LOW, VisualAlert.none, AudibleAlert.none, 5.), + }, }