mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-10-14 01:53:58 +08:00
Sync with CanBus helper
This commit is contained in:
@@ -287,7 +287,7 @@ class CarState(CarStateBase):
|
||||
else:
|
||||
messages.append(("LVR12", 100))
|
||||
|
||||
bus = 5 if CP.flags & HyundaiFlags.CAN_CANFD_HDA2.value else 0
|
||||
bus = CanBus(CP).ECAN if CP.flags & HyundaiFlags.CAN_CANFD_HDA2.value else 0
|
||||
return CANParser(DBC[CP.carFingerprint]["pt"], messages, bus)
|
||||
|
||||
@staticmethod
|
||||
@@ -314,7 +314,7 @@ class CarState(CarStateBase):
|
||||
if CP.flags & HyundaiFlags.CAN_CANFD_HDA2:
|
||||
messages.append(("CAM_0x2a4", 20))
|
||||
|
||||
bus = 6 if CP.flags & HyundaiFlags.CAN_CANFD_HDA2 else 2
|
||||
bus = CanBus(CP).CAM if CP.flags & HyundaiFlags.CAN_CANFD_HDA2 else 2
|
||||
return CANParser(DBC[CP.carFingerprint]["pt"], messages, bus)
|
||||
|
||||
def get_can_parser_canfd(self, CP):
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import crcmod
|
||||
from selfdrive.car.hyundai.hyundaicanfd import CanBus
|
||||
from selfdrive.car.hyundai.values import HyundaiFlags, CAR, CHECKSUM, CAMERA_SCC_CAR
|
||||
|
||||
hyundai_checksum = crcmod.mkCrcFun(0x11D, initCrc=0xFD, rev=False, xorOut=0xdf)
|
||||
@@ -112,7 +113,7 @@ def create_clu11(packer, frame, clu11, button, CP):
|
||||
values["CF_Clu_CruiseSwState"] = button
|
||||
values["CF_Clu_AliveCnt1"] = frame % 0x10
|
||||
# send buttons to camera on camera-scc based cars
|
||||
bus = 2 if CP.carFingerprint in CAMERA_SCC_CAR else 5 if CP.flags & HyundaiFlags.CAN_CANFD_HDA2 else 0
|
||||
bus = 2 if CP.carFingerprint in CAMERA_SCC_CAR else CanBus(CP).ECAN if CP.flags & HyundaiFlags.CAN_CANFD_HDA2 else 0
|
||||
return packer.make_can_msg("CLU11", bus, values)
|
||||
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ class CarInterface(CarInterfaceBase):
|
||||
if candidate in CANFD_CAR:
|
||||
ret.enableBsm = 0x1e5 in fingerprint[CAN.ECAN]
|
||||
else:
|
||||
bus = 5 if ret.flags & HyundaiFlags.CAN_CANFD_HDA2 else 0
|
||||
bus = CAN.ECAN if ret.flags & HyundaiFlags.CAN_CANFD_HDA2 else 0
|
||||
ret.enableBsm = 0x58b in fingerprint[bus]
|
||||
|
||||
# *** panda safety config ***
|
||||
|
||||
Reference in New Issue
Block a user