|
|
@ -189,13 +189,13 @@ class CarState(CarStateBase): |
|
|
|
cp.vl["BLINKERS"]["RIGHT_LAMP"]) |
|
|
|
cp.vl["BLINKERS"]["RIGHT_LAMP"]) |
|
|
|
|
|
|
|
|
|
|
|
ret.cruiseState.available = True |
|
|
|
ret.cruiseState.available = True |
|
|
|
ret.cruiseState.enabled = cp.vl["SCC1"]["CRUISE_ACTIVE"] == 1 |
|
|
|
|
|
|
|
self.is_metric = cp.vl["CLUSTER_INFO"]["DISTANCE_UNIT"] != 1 |
|
|
|
self.is_metric = cp.vl["CLUSTER_INFO"]["DISTANCE_UNIT"] != 1 |
|
|
|
if not self.CP.openpilotLongitudinalControl: |
|
|
|
if not self.CP.openpilotLongitudinalControl: |
|
|
|
speed_factor = CV.KPH_TO_MS if self.is_metric else CV.MPH_TO_MS |
|
|
|
speed_factor = CV.KPH_TO_MS if self.is_metric else CV.MPH_TO_MS |
|
|
|
cp_cruise_info = cp if self.CP.flags & HyundaiFlags.CANFD_HDA2 else cp_cam |
|
|
|
cp_cruise_info = cp if self.CP.flags & HyundaiFlags.CANFD_HDA2 else cp_cam |
|
|
|
ret.cruiseState.speed = cp_cruise_info.vl["CRUISE_INFO"]["SET_SPEED"] * speed_factor |
|
|
|
ret.cruiseState.speed = cp_cruise_info.vl["CRUISE_INFO"]["SET_SPEED"] * speed_factor |
|
|
|
ret.cruiseState.standstill = cp_cruise_info.vl["CRUISE_INFO"]["CRUISE_STANDSTILL"] == 1 |
|
|
|
ret.cruiseState.standstill = cp_cruise_info.vl["CRUISE_INFO"]["CRUISE_STANDSTILL"] == 1 |
|
|
|
|
|
|
|
ret.cruiseState.enabled = cp_cruise_info.vl["CRUISE_INFO"]["CRUISE_STATUS"] != 0 |
|
|
|
self.cruise_info = copy.copy(cp_cruise_info.vl["CRUISE_INFO"]) |
|
|
|
self.cruise_info = copy.copy(cp_cruise_info.vl["CRUISE_INFO"]) |
|
|
|
|
|
|
|
|
|
|
|
cruise_btn_msg = "CRUISE_BUTTONS_ALT" if self.CP.flags & HyundaiFlags.CANFD_ALT_BUTTONS else "CRUISE_BUTTONS" |
|
|
|
cruise_btn_msg = "CRUISE_BUTTONS_ALT" if self.CP.flags & HyundaiFlags.CANFD_ALT_BUTTONS else "CRUISE_BUTTONS" |
|
|
@ -452,6 +452,7 @@ class CarState(CarStateBase): |
|
|
|
|
|
|
|
|
|
|
|
if CP.flags & HyundaiFlags.CANFD_HDA2 and not CP.openpilotLongitudinalControl: |
|
|
|
if CP.flags & HyundaiFlags.CANFD_HDA2 and not CP.openpilotLongitudinalControl: |
|
|
|
signals += [ |
|
|
|
signals += [ |
|
|
|
|
|
|
|
("CRUISE_STATUS", "CRUISE_INFO"), |
|
|
|
("SET_SPEED", "CRUISE_INFO"), |
|
|
|
("SET_SPEED", "CRUISE_INFO"), |
|
|
|
("CRUISE_STANDSTILL", "CRUISE_INFO"), |
|
|
|
("CRUISE_STANDSTILL", "CRUISE_INFO"), |
|
|
|
] |
|
|
|
] |
|
|
|