From d2cd7210c39ceb4c65bedd707bed3abad9bc3fbd Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 13 May 2024 18:46:08 -0700 Subject: [PATCH] fix --- board/safety/safety_toyota.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }