DISCOVERY: Set safety model at the end

This commit is contained in:
Jason Wen
2023-02-20 18:28:59 -05:00
committed by GitHub
parent 2609eb6988
commit de91bb5283
+4 -4
View File
@@ -27,10 +27,6 @@ class CarInterface(CarInterfaceBase):
# added to selfdrive/car/tests/routes.py, we can remove it from this list.
ret.dashcamOnly = candidate in {CAR.KIA_OPTIMA_H, }
# detect platforms with HKG CAN and CAN-FD definitions
if 0x50 in fingerprint[5] and 0x420 in fingerprint[4]:
ret.flags |= HyundaiFlags.CAN_CANFD.value
if candidate in CANFD_CAR and not (ret.flags & HyundaiFlags.CAN_CANFD.value):
# detect HDA2 with ADAS Driving ECU
if Ecu.adas in [fw.ecu for fw in car_fw]:
@@ -291,6 +287,10 @@ class CarInterface(CarInterfaceBase):
elif candidate in EV_CAR:
ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_EV_GAS
# detect platforms with HKG CAN and CAN-FD definitions
if 0x50 in fingerprint[5] and 0x420 in fingerprint[4]:
ret.flags |= HyundaiFlags.CAN_CANFD.value
if candidate in (CAR.KONA, CAR.KONA_EV, CAR.KONA_HEV, CAR.KONA_EV_2022):
ret.flags |= HyundaiFlags.ALT_LIMITS.value
ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_ALT_LIMITS