From a127fe1a42b3ef87d96bc3e22ceeec8f74673ae3 Mon Sep 17 00:00:00 2001 From: ajouatom Date: Wed, 5 Feb 2025 13:49:23 +0900 Subject: [PATCH] fix for elentra cruise button --- opendbc_repo/opendbc/car/hyundai/carstate.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/opendbc_repo/opendbc/car/hyundai/carstate.py b/opendbc_repo/opendbc/car/hyundai/carstate.py index 41aa3f5..3bb80ab 100644 --- a/opendbc_repo/opendbc/car/hyundai/carstate.py +++ b/opendbc_repo/opendbc/car/hyundai/carstate.py @@ -225,14 +225,11 @@ class CarState(CarStateBase): #self.cruise_buttons.extend(cp.vl_all["CLU11"]["CF_Clu_CruiseSwState"]) #carrot {{ cruise_button = [Buttons.NONE] - if self.CP.extFlags & HyundaiExtFlags.CRUISE_BUTTON_ALT.value: + if self.CP.extFlags & HyundaiExtFlags.CRUISE_BUTTON_ALT.value and cp.vl_all["CRUISE_BUTTON_ALT"]["SET_ME_1"] == 1: lfa_button = cp.vl.get("CRUISE_BUTTON_LFA", {}).get("CruiseSwLfa", 0) cruise_button = [Buttons.LFA_BUTTON] if lfa_button > 0 else cp.vl_all["CRUISE_BUTTON_ALT"]["CruiseSwState"] - elif self.CP.extFlags & HyundaiExtFlags.HAS_LFA_BUTTON.value: - if cp.vl.get("BCM_PO_11", {}).get("LFA_Pressed", 0): - cruise_button = [Buttons.LFA_BUTTON] - else: - cruise_button = cp.vl_all["CLU11"]["CF_Clu_CruiseSwState"] + elif self.CP.extFlags & HyundaiExtFlags.HAS_LFA_BUTTON.value and cp.vl.get("BCM_PO_11", {}).get("LFA_Pressed", 0): + cruise_button = [Buttons.LFA_BUTTON] else: cruise_button = cp.vl_all["CLU11"]["CF_Clu_CruiseSwState"] self.cruise_buttons.extend(cruise_button)