From 312d6e0106a1cf7be2f45d1d5ff624b30d7fe557 Mon Sep 17 00:00:00 2001 From: Jason Young Date: Tue, 19 Jul 2022 20:51:34 -0400 Subject: [PATCH] better clarity --- selfdrive/car/volkswagen/carcontroller.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/selfdrive/car/volkswagen/carcontroller.py b/selfdrive/car/volkswagen/carcontroller.py index b402008041..feb57f4a54 100644 --- a/selfdrive/car/volkswagen/carcontroller.py +++ b/selfdrive/car/volkswagen/carcontroller.py @@ -94,11 +94,11 @@ class CarController: # **** ACC Button Controls ********************************************** # if self.CP.pcmCruise and self.frame % P.GRA_ACC_STEP == 0: - if CC.cruiseControl.cancel or CC.cruiseControl.resume: - idx = (CS.gra_stock_values["COUNTER"] + 1) % 16 - can_sends.append(self.create_acc_buttons_control(self.packer_pt, ext_bus, CS.gra_stock_values, idx, - cancel=CC.cruiseControl.cancel, - resume=CC.cruiseControl.resume)) + idx = (CS.gra_stock_values["COUNTER"] + 1) % 16 + if CC.cruiseControl.cancel: + can_sends.append(self.create_acc_buttons_control(self.packer_pt, ext_bus, CS.gra_stock_values, idx, cancel=True)) + elif CC.cruiseControl.resume: + can_sends.append(self.create_acc_buttons_control(self.packer_pt, ext_bus, CS.gra_stock_values, idx, resume=True)) new_actuators = actuators.copy() new_actuators.steer = self.apply_steer_last / P.STEER_MAX