GM: check steer req bit (#1629)

for gm
This commit is contained in:
Justin Newberry 2023-08-31 16:01:05 -07:00 committed by GitHub
parent f4d0904d94
commit fbe81a1753
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -176,7 +176,9 @@ static int gm_tx_hook(CANPacket_t *to_send) {
int desired_torque = ((GET_BYTE(to_send, 0) & 0x7U) << 8) + GET_BYTE(to_send, 1);
desired_torque = to_signed(desired_torque, 11);
if (steer_torque_cmd_checks(desired_torque, -1, GM_STEERING_LIMITS)) {
bool steer_req = (GET_BIT(to_send, 3U) != 0U);
if (steer_torque_cmd_checks(desired_torque, steer_req, GM_STEERING_LIMITS)) {
tx = 0;
}
}

View File

@ -131,7 +131,7 @@ class TestGmSafetyBase(common.PandaSafetyTest, common.DriverTorqueSteeringSafety
return self.packer.make_can_msg_panda("PSCMStatus", 0, values)
def _torque_cmd_msg(self, torque, steer_req=1):
values = {"LKASteeringCmd": torque}
values = {"LKASteeringCmd": torque, "LKASteeringCmdActive": steer_req}
return self.packer.make_can_msg_panda("ASCMLKASteeringCmd", 0, values)
def _button_msg(self, buttons):