Ford: fix counter in LateralMotionControl2 message (#31806)

The counter should be between 0-15 inclusive. This only affects CAN FD cars.
This commit is contained in:
Cameron Clough
2024-03-10 04:54:54 +00:00
committed by GitHub
parent a475417220
commit 682f16d1b5
+1 -1
View File
@@ -73,7 +73,7 @@ class CarController(CarControllerBase):
if self.CP.flags & FordFlags.CANFD:
# TODO: extended mode
mode = 1 if CC.latActive else 0
counter = (self.frame // CarControllerParams.STEER_STEP) % 0xF
counter = (self.frame // CarControllerParams.STEER_STEP) % 0x10
can_sends.append(fordcan.create_lat_ctl2_msg(self.packer, self.CAN, mode, 0., 0., -apply_curvature, 0., counter))
else:
can_sends.append(fordcan.create_lat_ctl_msg(self.packer, self.CAN, CC.latActive, 0., 0., -apply_curvature, 0.))