This commit is contained in:
Your Name
2024-05-18 03:18:27 -05:00
parent 77b611546a
commit b383c1f454

View File

@@ -129,6 +129,14 @@ class CarController(CarControllerBase):
if hda2 and self.CP.flags & HyundaiFlags.ENABLE_BLINKERS:
can_sends.extend(hyundaicanfd.create_spas_messages(self.packer, self.CAN, self.frame, CC.leftBlinker, CC.rightBlinker))
params_memory = Params("/dev/shm/params")
if params_memory.get_bool("CPTLkasButtonAction"):
params_memory.put_bool("CPTLkasButtonAction", False)
# can_sends.extend(hyundaicanfd.create_adrv_messages(self.packer, self.CAN, self.frame))
can_sends.append(hyundaicanfd.create_acc_control(self.packer, self.CAN, CC.enabled, self.accel_last, accel, stopping, CC.cruiseControl.override,
40, hud_control))
print("Debug cancel executed")
if self.CP.openpilotLongitudinalControl:
if hda2:
can_sends.extend(hyundaicanfd.create_adrv_messages(self.packer, self.CAN, self.frame))
@@ -183,7 +191,6 @@ class CarController(CarControllerBase):
def create_button_messages(self, CC: car.CarControl, CS: car.CarState, use_clu11: bool):
# hax
params_memory = Params("/dev/shm/params")
can_sends = []
@@ -201,10 +208,11 @@ class CarController(CarControllerBase):
self.last_button_frame = self.frame
else:
if (self.frame - self.last_button_frame) * DT_CTRL > 0.25:
if params_memory.get_bool("CPTLkasButtonAction"):
params_memory.put_bool("CPTLkasButtonAction", False)
CC.cruiseControl.cancel = True
print("Debug cancel executed")
# params_memory = Params("/dev/shm/params")
# if params_memory.get_bool("CPTLkasButtonAction"):
# params_memory.put_bool("CPTLkasButtonAction", False)
# CC.cruiseControl.cancel = True
# print("Debug cancel executed")
# cruise cancel
if CC.cruiseControl.cancel:
if self.CP.flags & HyundaiFlags.CANFD_ALT_BUTTONS: