wip
This commit is contained in:
@@ -58,6 +58,9 @@ class CarState(CarStateBase):
|
||||
# FrogPilot variables
|
||||
self.main_enabled = False
|
||||
|
||||
# Clearpilot variables
|
||||
self.fix_main_enabled_check = True
|
||||
|
||||
def calculate_speed_limit(self, cp, cp_cam):
|
||||
if self.CP.carFingerprint in CANFD_CAR:
|
||||
speed_limit_bus = cp if self.CP.flags & HyundaiFlags.CANFD_HDA2 else cp_cam
|
||||
@@ -272,6 +275,10 @@ class CarState(CarStateBase):
|
||||
self.main_buttons.extend(cp.vl_all[self.cruise_btns_msg_canfd]["ADAPTIVE_CRUISE_MAIN_BTN"])
|
||||
if self.prev_main_buttons == 0 and self.main_buttons[-1] != 0:
|
||||
self.main_enabled = not self.main_enabled
|
||||
if self.fix_main_enabled_check:
|
||||
self.fix_main_enabled_check = False
|
||||
if ret.cruiseState.speed > 1 and self.main_enabled == False
|
||||
self.main_enabled = True
|
||||
self.buttons_counter = cp.vl[self.cruise_btns_msg_canfd]["COUNTER"]
|
||||
ret.accFaulted = cp.vl["TCS"]["ACCEnable"] != 0 # 0 ACC CONTROL ENABLED, 1-3 ACC CONTROL DISABLED
|
||||
|
||||
|
||||
Reference in New Issue
Block a user