From 90e829b8a23e84d8ea47a248295bf54181cc3c19 Mon Sep 17 00:00:00 2001 From: Jaosn Wen Date: Wed, 17 Jul 2024 11:22:05 -0400 Subject: [PATCH] MADS: HKG CAN-FD: Disallow cruise buttons to engage when pcmCruiseSpeed is off --- selfdrive/car/hyundai/carstate.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/selfdrive/car/hyundai/carstate.py b/selfdrive/car/hyundai/carstate.py index d8329c5ba7..5261fc8477 100644 --- a/selfdrive/car/hyundai/carstate.py +++ b/selfdrive/car/hyundai/carstate.py @@ -282,6 +282,8 @@ class CarState(CarStateBase): ret.cruiseState.standstill = False else: cp_cruise_info = cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp + ret.cruiseState.available = cp_cruise_info.vl["SCC_CONTROL"]["MainMode_ACC"] == 1 if not self.CP.pcmCruiseSpeed else \ + ret.cruiseState.available ret.cruiseState.enabled = cp_cruise_info.vl["SCC_CONTROL"]["ACCMode"] in (1, 2) ret.cruiseState.standstill = cp_cruise_info.vl["SCC_CONTROL"]["CRUISE_STANDSTILL"] == 1 ret.cruiseState.speed = cp_cruise_info.vl["SCC_CONTROL"]["VSetDis"] * speed_factor