From a4f130ba4449237af07ff039bd732d7c62bfc9f6 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 5 Feb 2024 01:22:54 -0600 Subject: [PATCH] wip --- selfdrive/car/hyundai/carstate.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/selfdrive/car/hyundai/carstate.py b/selfdrive/car/hyundai/carstate.py index 950fbf7..7ddc779 100644 --- a/selfdrive/car/hyundai/carstate.py +++ b/selfdrive/car/hyundai/carstate.py @@ -298,13 +298,15 @@ class CarState(CarStateBase): self.custom_speed_up = False self.custom_speed_down = False - if self.cruise_buttons[-1] == Buttons.GAP_DIST and self.prev_cruise_buttons == 0: - self.custom_speed_down = True + if ret.cruiseState.available: - lkas_pressed = cp.vl[self.cruise_btns_msg_canfd]["LKAS_BTN"] - if lkas_pressed and not self.lkas_previously_pressed: - self.custom_speed_up = True - self.lkas_previously_pressed = lkas_pressed + if self.cruise_buttons[-1] == Buttons.GAP_DIST and self.prev_cruise_buttons == 0: + self.custom_speed_down = True + + lkas_pressed = cp.vl[self.cruise_btns_msg_canfd]["LKAS_BTN"] + if lkas_pressed and not self.lkas_previously_pressed: + self.custom_speed_up = True + self.lkas_previously_pressed = lkas_pressed # Driving personalities function