diff --git a/selfdrive/car/gm/carcontroller.py b/selfdrive/car/gm/carcontroller.py index 2b3bdc1fce..e6ba7390a5 100644 --- a/selfdrive/car/gm/carcontroller.py +++ b/selfdrive/car/gm/carcontroller.py @@ -113,7 +113,7 @@ class CarController: else: # Silence "Take Steering" alert sent by camera, send PSCMStatus with HandsOffSWlDetectionStatus=1 if self.frame % 500 == 0: - can_sends.append(gmcan.create_pscm_status(self.packer_pt, CS.pscm_status)) + can_sends.append(gmcan.create_pscm_status(self.packer_pt, CS.pscm_status_counter)) # Stock longitudinal, integrated at camera if (self.frame - self.last_button_frame) * DT_CTRL > 0.04: diff --git a/selfdrive/car/gm/gmcan.py b/selfdrive/car/gm/gmcan.py index 76b9b99a70..4ef72b8c7f 100644 --- a/selfdrive/car/gm/gmcan.py +++ b/selfdrive/car/gm/gmcan.py @@ -7,12 +7,12 @@ def create_buttons(packer, bus, idx, button): } return packer.make_can_msg("ASCMSteeringButton", bus, values) -def create_pscm_status(packer, pscm_status): +def create_pscm_status(packer, idx): values = { "HandsOffSWDetectionMode": 1, "HandsOffSWlDetectionStatus": 1, "LKATorqueDeliveredStatus": 0, - "RollingCounter": int(pscm_status["RollingCounter"] + 1) & 0xf, + "RollingCounter": int(idx + 1) & 0xf, } values["PSCMStatusChecksum"] = (0x30 + (values['HandsOffSWlDetectionStatus'] << 5) + (values['LKATorqueDeliveredStatus'] << 3) +