guard off frames.

This commit is contained in:
firestar5683
2025-05-22 00:22:58 -05:00
parent 729ee3cc99
commit deb5322c40
+3 -1
View File
@@ -161,9 +161,11 @@ class CarController(CarControllerBase):
# while frames remain, send off spoof if not colliding with steer
if getattr(self, "off_spoof_frames", 0) > 0:
if self.frame != self.last_steer_frame:
# send off messages
can_sends.append(gmcan.create_prndl2_command(self.packer_pt, CanBus.POWERTRAIN, False))
can_sends.append(gmcan.create_regen_paddle_command(self.packer_pt, CanBus.POWERTRAIN, False))
self.off_spoof_frames -= 1
# decrement only when sent
self.off_spoof_frames -= 1
# Update regen_active state
self.last_regen_active = regen_active