diff --git a/selfdrive/car/mazda/carcontroller.py b/selfdrive/car/mazda/carcontroller.py index 12d3e66b26..5714bdaf0d 100644 --- a/selfdrive/car/mazda/carcontroller.py +++ b/selfdrive/car/mazda/carcontroller.py @@ -9,7 +9,7 @@ class CarController(): self.packer = CANPacker(dbc_name) self.steer_rate_limited = False - def update(self, enabled, CS, frame, actuators, pcm_cancel_cmd): + def update(self, enabled, CS, frame, actuators): """ Controls thread """ can_sends = [] @@ -31,8 +31,8 @@ class CarController(): else: apply_steer = 0 self.steer_rate_limited = False - if pcm_cancel_cmd and frame % 10 == 0: - # Cancel Stock ACC if it's engaged with OP disengaged + if CS.out.cruiseState.enabled and frame % 10 == 0: + # Cancel Stock ACC if it's enabled while OP is disengaged # Match stock message rate which is sent at 10hz can_sends.append(mazdacan.create_button_cmd(self.packer, CS.CP.carFingerprint, Buttons.CANCEL)) diff --git a/selfdrive/car/mazda/interface.py b/selfdrive/car/mazda/interface.py index 5856b60c25..1e6b05ba02 100755 --- a/selfdrive/car/mazda/interface.py +++ b/selfdrive/car/mazda/interface.py @@ -89,7 +89,6 @@ class CarInterface(CarInterfaceBase): return self.CS.out def apply(self, c): - can_sends = self.CC.update(c.enabled, self.CS, self.frame, c.actuators, - c.cruiseControl.cancel) + can_sends = self.CC.update(c.enabled, self.CS, self.frame, c.actuators) self.frame += 1 return can_sends