Skip to content

Commit 95719e2

Browse files
committed
check flags too
1 parent 4fd8b2d commit 95719e2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

opendbc/car/hyundai/carcontroller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def update(self, CC, CS, now_nanos):
116116

117117
# LFA and HDA icons
118118
if self.frame % 5 == 0 and (not hda2 or hda2_long):
119-
if HyundaiFlags.CCNC:
119+
if self.CP.flags & HyundaiFlags.CCNC:
120120
can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.frame, self.CP, CC, CS))
121121
else:
122122
can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled))

opendbc/car/hyundai/carstate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@ def update_canfd(self, can_parsers) -> structs.CarState:
227227
ret.steeringPressed = self.update_steering_pressed(abs(ret.steeringTorque) > self.params.STEER_THRESHOLD, 5)
228228
ret.steerFaultTemporary = cp.vl["MDPS"]["LKA_FAULT"] != 0
229229

230-
if HyundaiFlags.CCNC:
230+
if self.CP.flags & HyundaiFlags.CCNC:
231231
self.msg_161 = copy.copy(cp_cam.vl["MSG_161"])
232232
self.msg_162 = copy.copy(cp_cam.vl["MSG_162"])
233233

234-
alt = "_ALT" if HyundaiFlags.CCNC else ""
234+
alt = "_ALT" if self.CP.flags & HyundaiFlags.CCNC else ""
235235
ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][f"LEFT_LAMP{alt}"],
236236
cp.vl["BLINKERS"][f"RIGHT_LAMP{alt}"])
237237
if self.CP.enableBsm:
@@ -320,7 +320,7 @@ def get_can_parsers_canfd(self, CP):
320320
cam_messages += [
321321
("SCC_CONTROL", 50),
322322
]
323-
if HyundaiFlags.CCNC:
323+
if CP.flags & HyundaiFlags.CCNC:
324324
cam_messages += [
325325
("MSG_161", 20),
326326
("MSG_162", 20),

0 commit comments

Comments
 (0)