diff --git a/board/safety/safety_toyota.h b/board/safety/safety_toyota.h index 8a037675f..3baab49ea 100644 --- a/board/safety/safety_toyota.h +++ b/board/safety/safety_toyota.h @@ -260,12 +260,12 @@ static bool toyota_tx_hook(const CANPacket_t *to_send) { // check if we should wind down torque // Use lowest of current sample and 3 msgs ago (60ms for STEER_TORQUE_SENSOR at 50Hz) - int driver_torque = MIN(ABS(driver_torque[0]), ABS(driver_torque[3])); + int driver_torque = MIN(ABS(torque_driver.values[0]), ABS(torque_driver.values[3])); if ((driver_torque > TOYOTA_LTA_MAX_DRIVER_TORQUE) && (torque_wind_down != 0)) { tx = false; } - int eps_torque = MIN(ABS(torque_meas.min), ABS(torque_meas.max)); + int eps_torque = MIN(ABS(torque_meas.values[0]), ABS(torque_meas.values[3])); if ((eps_torque > TOYOTA_LTA_MAX_MEAS_TORQUE) && (torque_wind_down != 0)) { tx = false; }