diff --git a/selfdrive/car/hyundai/interface.py b/selfdrive/car/hyundai/interface.py index 88466e331..4d7e0736c 100644 --- a/selfdrive/car/hyundai/interface.py +++ b/selfdrive/car/hyundai/interface.py @@ -228,14 +228,7 @@ class CarInterface(CarInterfaceBase): ret.longitudinalTuning.kiV = [0.0] ret.experimentalLongitudinalAvailable = candidate not in (LEGACY_SAFETY_MODE_CAR | CAMERA_SCC_CAR) - params = Params() - dp_atl = int(params.get("dp_atl").decode('utf-8')) - if dp_atl > 0: - ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HYUNDAI_ALKA - if dp_atl == 1: - ret.openpilotLongitudinalControl = False - - ret.openpilotLongitudinalControl = experimental_long and ret.experimentalLongitudinalAvailable and dp_atl != 1 + ret.openpilotLongitudinalControl = experimental_long and ret.experimentalLongitudinalAvailable ret.pcmCruise = not ret.openpilotLongitudinalControl ret.stoppingControl = True @@ -276,6 +269,15 @@ class CarInterface(CarInterfaceBase): if candidate in CAMERA_SCC_CAR: ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HYUNDAI_CAMERA_SCC + params = Params() + dp_atl = int(params.get("dp_atl").decode('utf-8')) + if dp_atl > 0: + ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HYUNDAI_ALKA + if dp_atl == 1: + ret.openpilotLongitudinalControl = False + # update pcmCruise again + ret.pcmCruise = not ret.openpilotLongitudinalControl + if ret.openpilotLongitudinalControl: ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_LONG if candidate in HYBRID_CAR: