Skip to content

Commit

Permalink
Fix MISRA violation (commaai#1109)
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane authored Oct 18, 2022
1 parent 842cf65 commit 9ed3f75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion board/safety/safety_hyundai_canfd.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ static int hyundai_canfd_tx_hook(CANPacket_t *to_send, bool longitudinal_allowed
// steering
const int steer_addr = (hyundai_canfd_hda2 && !hyundai_longitudinal) ? 0x50 : 0x12a;
if (addr == steer_addr) {
int desired_torque = (((GET_BYTE(to_send, 6) & 0xFU) << 7U) | (GET_BYTE(to_send, 5) >> 1U)) - 1024;
int desired_torque = (((GET_BYTE(to_send, 6) & 0xFU) << 7U) | (GET_BYTE(to_send, 5) >> 1U)) - 1024U;
bool steer_req = GET_BIT(to_send, 52U) != 0U;

if (steer_torque_cmd_checks(desired_torque, steer_req, HYUNDAI_CANFD_STEERING_LIMITS)) {
Expand Down

0 comments on commit 9ed3f75

Please sign in to comment.