MADS: HKG CAN-FD: Disallow cruise buttons to engage when pcmCruiseSpeed is off

This commit is contained in:
Jaosn Wen
2024-07-17 11:22:05 -04:00
parent faf52492b6
commit 90e829b8a2
+2
View File
@@ -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