mirror of https://github.com/commaai/panda.git
parent
4303ae1387
commit
d74b197f53
|
@ -236,6 +236,11 @@ static bool hyundai_canfd_tx_hook(const CANPacket_t *to_send) {
|
|||
if (addr == steer_addr) {
|
||||
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);
|
||||
int max_torque = GET_BYTE(to_send, 12U);
|
||||
|
||||
if (!controls_allowed && (max_torque != 0)) {
|
||||
tx = false;
|
||||
}
|
||||
|
||||
if (steer_torque_cmd_checks(desired_torque, steer_req, HYUNDAI_CANFD_STEERING_LIMITS)) {
|
||||
tx = false;
|
||||
|
|
Loading…
Reference in New Issue