Ford: fix counter in LateralMotionControl2 message (#31806)

The counter should be between 0-15 inclusive. This only affects CAN FD cars.
old-commit-hash: 682f16d1b5c9c5d618711d864a16efde80af8e14
This commit is contained in:
Cameron Clough
2024-03-10 04:54:54 +00:00
committed by GitHub
parent af33a383a5
commit b9980e5bcc
+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.))