From 054920a347d09d1f0466033d430024baf12e86f9 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 21 Dec 2024 00:06:23 -0500 Subject: [PATCH] only if enabled --- opendbc/car/hyundai/hyundaicanfd.py | 30 +++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index f6bd05acde..d8addf24ab 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -137,25 +137,27 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): enabled = CC.enabled hud = CC.hudControl - # HIDE FAULTS - for f in ("FAULT_LSS", "FAULT_HDA", "FAULT_DAS"): - msg_162[f] = 0 + if enabled: + + # HIDE FAULTS + for f in ("FAULT_LSS", "FAULT_HDA", "FAULT_DAS"): + msg_162[f] = 0 - # HIDE ALERTS - if msg_161.get("ALERTS_5") == 2: # WATCH_FOR_SURROUNDING_VEHICLES - msg_161["ALERTS_5"] = 0 + # HIDE ALERTS + if msg_161.get("ALERTS_5") == 2: # WATCH_FOR_SURROUNDING_VEHICLES + msg_161["ALERTS_5"] = 0 - if msg_161.get("ALERTS_5") == 4: # SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET - msg_161["ALERTS_5"] = 0 + if msg_161.get("ALERTS_5") == 4: # SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET + msg_161["ALERTS_5"] = 0 - if msg_161.get("ALERTS_5") == 5: # USE_SWITCH_OR_PEDAL_TO_ACCELERATE - msg_161["ALERTS_5"] = 0 + if msg_161.get("ALERTS_5") == 5: # USE_SWITCH_OR_PEDAL_TO_ACCELERATE + msg_161["ALERTS_5"] = 0 - if msg_161.get("ALERTS_2") == 5: # CONSIDER_TAKING_A_BREAK - msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0, "DAW_ICON": 0}) + if msg_161.get("ALERTS_2") == 5: # CONSIDER_TAKING_A_BREAK + msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0, "DAW_ICON": 0}) - if msg_161.get("SOUNDS_4") == 2 and msg_161.get("LFA_ICON") in (3, 0,): # LFA BEEPS - msg_161["SOUNDS_4"] = 0 + if msg_161.get("SOUNDS_4") == 2 and msg_161.get("LFA_ICON") in (3, 0,): # LFA BEEPS + msg_161["SOUNDS_4"] = 0 # ICONS, LANELINES msg_161.update({