cleanup and fixes

This commit is contained in:
Jason Wen
2023-08-27 01:37:40 -04:00
parent 4d51231156
commit 884ccaaa9f
2 changed files with 12 additions and 11 deletions
+11 -10
View File
@@ -258,15 +258,16 @@ class CarState(CarStateBase):
("SAS11", 100),
]
if not CP.openpilotLongitudinalControl and CP.carFingerprint not in CAMERA_SCC_CAR and not (CP.flags & HyundaiFlags.CAN_CANFD.value):
messages += [
("SCC11", 50),
("SCC12", 50),
]
if CP.flags & HyundaiFlags.USE_FCA.value:
messages.append(("FCA11", 50))
elif CP.flags & HyundaiFlags.CAN_CANFD.value:
messages.append(("SCC12", 50))
if not CP.openpilotLongitudinalControl:
if CP.flags & HyundaiFlags.CAN_CANFD.value:
messages.append(("SCC12", 50))
elif CP.carFingerprint not in CAMERA_SCC_CAR:
messages += [
("SCC11", 50),
("SCC12", 50),
]
if CP.flags & HyundaiFlags.USE_FCA.value:
messages.append(("FCA11", 50))
if CP.enableBsm:
freq_lca11 = 20 if CP.flags & HyundaiFlags.CAN_CANFD.value else 50
@@ -294,7 +295,7 @@ class CarState(CarStateBase):
@staticmethod
def get_cam_can_parser(CP):
if CP.carFingerprint in CANFD_CAR:
if CP.carFingerprint in (CANFD_CAR - CAN_CANFD_CAR):
return CarState.get_cam_can_parser_canfd(CP)
messages = []
+1 -1
View File
@@ -1,5 +1,5 @@
import crcmod
from selfdrive.car.hyundai.hyundaicanfd import CanBus
from openpilot.selfdrive.car.hyundai.hyundaicanfd import CanBus
from openpilot.selfdrive.car.hyundai.values import HyundaiFlags, CAR, CHECKSUM, CAMERA_SCC_CAR
hyundai_checksum = crcmod.mkCrcFun(0x11D, initCrc=0xFD, rev=False, xorOut=0xdf)