MADS: Toyota: handle pedal disengage (#244)

This commit is contained in:
Jason Wen
2023-09-04 19:29:11 -04:00
committed by GitHub
parent e362198880
commit 3d87d88dc6
+5
View File
@@ -338,6 +338,11 @@ class CarInterface(CarInterfaceBase):
else:
self.CS.madsEnabled = False
if self.get_sp_pedal_disengage(ret):
self.CS.madsEnabled, self.CS.accEnabled = self.get_sp_cancel_cruise_state(self.CS.madsEnabled)
if not self.CP.pcmCruise:
ret.cruiseState.enabled = self.CS.accEnabled
ret, self.CS = self.get_sp_common_state(ret, self.CS, gap_button=bool(self.CS.gap_dist_button))
# CANCEL