From b601a1c626137a86bca8714c6b0bb123d5ebbd74 Mon Sep 17 00:00:00 2001 From: IanBoraks Date: Sun, 23 Aug 2026 11:13:08 -0700 Subject: [PATCH] Cherry Pick Jafaral 63fd793 --- opendbc/car/mazda/carcontroller.py | 4 +--- opendbc/car/mazda/carstate.py | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/opendbc/car/mazda/carcontroller.py b/opendbc/car/mazda/carcontroller.py index d57c490eb6a..adfc70c089e 100644 --- a/opendbc/car/mazda/carcontroller.py +++ b/opendbc/car/mazda/carcontroller.py @@ -74,9 +74,7 @@ def update(self, CC, CC_SP, CS, now_nanos): # send HUD alerts if self.frame % 50 == 0: ldw = CC.hudControl.visualAlert == VisualAlert.ldw - steer_required = CC.hudControl.visualAlert == VisualAlert.steerRequired - # TODO: find a way to silence audible warnings so we can add more hud alerts - steer_required = steer_required and CS.lkas_allowed_speed + steer_required = CS.out.steerFaultTemporary can_sends.append(mazdacan.create_alert_command(self.packer, CS.cam_laneinfo, ldw, steer_required)) # send steering command diff --git a/opendbc/car/mazda/carstate.py b/opendbc/car/mazda/carstate.py index 5b5e7cfba0c..c472f33bffe 100644 --- a/opendbc/car/mazda/carstate.py +++ b/opendbc/car/mazda/carstate.py @@ -198,7 +198,8 @@ def update(self, can_parsers) -> tuple[structs.CarState, structs.CarStateSP]: # it should be enabled (steer lockout). Don't warn until we actually get lkas active # and lose it again, i.e, after initial lkas activation if self.CP.minSteerSpeed > 0: - ret.steerFaultTemporary = self.lkas_allowed_speed and lkas_blocked + # On if no driver torque the last 5 seconds + ret.steerFaultTemporary = cp.vl["STEER_RATE"]["HANDS_OFF_5_SECONDS"] == 1 else: # CX-5 2022: EPS accepts steering at all speeds regardless of LKAS_BLOCK. # Verified across 5.5M frames: LKAS_BLOCK never indicates a real steering failure.