This commit is contained in:
Your Name
2024-05-04 01:47:00 -05:00
parent d79b78041d
commit 5f72cb370b
2 changed files with 9 additions and 1 deletions

View File

@@ -186,6 +186,7 @@ class CarController(CarControllerBase):
if use_clu11:
if CC.cruiseControl.cancel:
can_sends.append(hyundaican.create_clu11(self.packer, self.frame, CS.clu11, Buttons.CANCEL, self.CP))
CS.lkas_trigger_result = 5
elif CC.cruiseControl.resume:
# send resume at a max freq of 10Hz
if (self.frame - self.last_button_frame) * DT_CTRL > 0.1:
@@ -200,20 +201,24 @@ class CarController(CarControllerBase):
if self.CP.flags & HyundaiFlags.CANFD_ALT_BUTTONS:
can_sends.append(hyundaicanfd.create_acc_cancel(self.packer, self.CP, self.CAN, CS.cruise_info))
self.last_button_frame = self.frame
CS.lkas_trigger_result = 1
else:
for _ in range(20):
can_sends.append(hyundaicanfd.create_buttons(self.packer, self.CP, self.CAN, CS.buttons_counter+1, Buttons.CANCEL))
self.last_button_frame = self.frame
CS.lkas_trigger_result = 2
# cruise standstill resume
# elif CC.cruiseControl.resume:
elif CC.cruiseControl.resume or CS.lkas_enabled:
elif CC.cruiseControl.resume:
if self.CP.flags & HyundaiFlags.CANFD_ALT_BUTTONS:
# TODO: resume for alt button cars
CS.lkas_trigger_result = 3
pass
else:
for _ in range(20):
can_sends.append(hyundaicanfd.create_buttons(self.packer, self.CP, self.CAN, CS.buttons_counter+1, Buttons.RES_ACCEL))
self.last_button_frame = self.frame
CS.lkas_trigger_result = 4
return can_sends