Skip to content

Commit

Permalink
one liner
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Oct 12, 2022
1 parent 6e640e4 commit 5c4505d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions board/safety/safety_hyundai_canfd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5c4505d

Please sign in to comment.