From 5c4505ddc9f33c12e5e2aab534444b8760b75539 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Wed, 12 Oct 2022 13:13:58 -0700 Subject: [PATCH] one liner --- board/safety/safety_hyundai_canfd.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/board/safety/safety_hyundai_canfd.h b/board/safety/safety_hyundai_canfd.h index b11b62f9b0..4eb0e7dd96 100644 --- a/board/safety/safety_hyundai_canfd.h +++ b/board/safety/safety_hyundai_canfd.h @@ -211,9 +211,8 @@ static int hyundai_canfd_tx_hook(CANPacket_t *to_send, bool longitudinal_allowed // steering if ((addr == 0x50) || (addr == 0x12a)) { - int desired_torque = ((GET_BYTE(to_send, 6) & 0xFU) << 7U) | (GET_BYTE(to_send, 5) >> 1U); + int desired_torque = (((GET_BYTE(to_send, 6) & 0xFU) << 7U) | (GET_BYTE(to_send, 5) >> 1U)) - 1024; bool steer_req = GET_BIT(to_send, 52U) != 0U; - desired_torque -= 1024; if (steer_torque_cmd_checks(desired_torque, steer_req, HYUNDAI_CANFD_STEERING_LIMITS)) { tx = 0;