diff --git a/board/safety/safety_subaru_preglobal.h b/board/safety/safety_subaru_preglobal.h index b30af3d4aa..f644d339d7 100644 --- a/board/safety/safety_subaru_preglobal.h +++ b/board/safety/safety_subaru_preglobal.h @@ -92,7 +92,9 @@ static int subaru_preglobal_tx_hook(CANPacket_t *to_send) { int desired_torque = ((GET_BYTES(to_send, 0, 4) >> 8) & 0x1FFFU); desired_torque = -1 * to_signed(desired_torque, 13); - if (steer_torque_cmd_checks(desired_torque, -1, SUBARU_PG_STEERING_LIMITS)) { + bool steer_req = (GET_BIT(to_send, 24U) != 0U); + + if (steer_torque_cmd_checks(desired_torque, steer_req, SUBARU_PG_STEERING_LIMITS)) { tx = 0; } diff --git a/tests/safety/test_subaru_preglobal.py b/tests/safety/test_subaru_preglobal.py index 40362e3728..5e20dc5039 100755 --- a/tests/safety/test_subaru_preglobal.py +++ b/tests/safety/test_subaru_preglobal.py @@ -49,7 +49,7 @@ def _user_brake_msg(self, brake): return self.packer.make_can_msg_panda("Brake_Pedal", 0, values) def _torque_cmd_msg(self, torque, steer_req=1): - values = {"LKAS_Command": torque} + values = {"LKAS_Command": torque, "LKAS_Active": steer_req} return self.packer.make_can_msg_panda("ES_LKAS", 0, values) def _user_gas_msg(self, gas):