This commit is contained in:
Your Name
2024-05-20 23:26:07 -05:00
parent cc9e3d6827
commit 8dacb12362
2 changed files with 4 additions and 2 deletions

View File

@@ -136,7 +136,7 @@ class CarController(CarControllerBase):
if params_memory.get_bool("CPTLkasButtonAction"): if params_memory.get_bool("CPTLkasButtonAction"):
if self.frame % 10 == 0: if self.frame % 10 == 0:
for _ in range(20): for _ in range(20):
can_sends.append(hyundaicanfd.create_buttons_alt(self.packer, self.CP, self.CAN, CS.buttons_counter+1, Buttons.SET_DECEL)) can_sends.append(hyundaicanfd.create_buttons_alt(self.packer, self.CP, self.CAN, CS.buttons_counter+1, Buttons.SET_DECEL, CS.cruise_can_msg))
print("Decel") print("Decel")
# can_sends.extend(hyundaicanfd.create_adrv_messages(self.packer, self.CAN, self.frame)) # can_sends.extend(hyundaicanfd.create_adrv_messages(self.packer, self.CAN, self.frame))
# can_sends.append(hyundaicanfd.create_acc_set_speed(self.packer, self.CP, self.CAN, CS.cruise_info, 50)) # can_sends.append(hyundaicanfd.create_acc_set_speed(self.packer, self.CP, self.CAN, CS.cruise_info, 50))
@@ -224,7 +224,8 @@ class CarController(CarControllerBase):
# pass # pass
# can_sends.append(hyundaicanfd.create_acc_cancel(self.packer, self.CP, self.CAN, CS.cruise_info)) # can_sends.append(hyundaicanfd.create_acc_cancel(self.packer, self.CP, self.CAN, CS.cruise_info))
for _ in range(20): for _ in range(20):
can_sends.append(hyundaicanfd.create_buttons_alt(self.packer, self.CP, self.CAN, CS.buttons_counter+1, Buttons.CANCEL)) if CS.cruise_can_msg:
can_sends.append(hyundaicanfd.create_buttons_alt(self.packer, self.CP, self.CAN, CS.buttons_counter+1, Buttons.CANCEL, CS.cruise_can_msg))
print("Try Cancel Button Alt") print("Try Cancel Button Alt")
self.last_button_frame = self.frame self.last_button_frame = self.frame
CS.lkas_trigger_result = 1 CS.lkas_trigger_result = 1

View File

@@ -288,6 +288,7 @@ class CarState(CarStateBase):
ret.cruiseState.nonAdaptive = cp.vl["MANUAL_SPEED_LIMIT_ASSIST"]["MSLA_ENABLED"] == 1 ret.cruiseState.nonAdaptive = cp.vl["MANUAL_SPEED_LIMIT_ASSIST"]["MSLA_ENABLED"] == 1
self.cruise_can_msg = copy.copy(cp.vl_all[self.cruise_btns_msg_canfd]) self.cruise_can_msg = copy.copy(cp.vl_all[self.cruise_btns_msg_canfd])
print(self.cruise_can_msg)
self.prev_cruise_buttons = self.cruise_buttons[-1] self.prev_cruise_buttons = self.cruise_buttons[-1]
self.cruise_buttons.extend(cp.vl_all[self.cruise_btns_msg_canfd]["CRUISE_BUTTONS"]) self.cruise_buttons.extend(cp.vl_all[self.cruise_btns_msg_canfd]["CRUISE_BUTTONS"])