From 894572c84366e759b9ba437c773e9ae86dff2a87 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Wed, 11 Apr 2018 14:34:17 -0700 Subject: [PATCH] fix tests --- tests/safety/test.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/safety/test.c b/tests/safety/test.c index 84278b76578307..661b0a991d7666 100644 --- a/tests/safety/test.c +++ b/tests/safety/test.c @@ -22,6 +22,8 @@ typedef struct uint32_t CNT; } TIM_TypeDef; +struct sample_t torque_meas; + TIM_TypeDef timer; TIM_TypeDef *TIM2 = &timer; @@ -43,6 +45,10 @@ void set_controls_allowed(int c){ controls_allowed = c; } +void reset_angle_control(void){ + angle_control = 0; +} + int get_controls_allowed(void){ return controls_allowed; } @@ -52,16 +58,16 @@ void set_timer(int t){ } void set_torque_meas(int min, int max){ - torque_meas_min = min; - torque_meas_max = max; + torque_meas.min = min; + torque_meas.max = max; } int get_torque_meas_min(void){ - return torque_meas_min; + return torque_meas.min; } int get_torque_meas_max(void){ - return torque_meas_max; + return torque_meas.max; } void set_rt_torque_last(int t){ @@ -85,8 +91,8 @@ int get_gas_prev(void){ } void init_tests_toyota(void){ - torque_meas_min = 0; - torque_meas_max = 0; + torque_meas.min = 0; + torque_meas.max = 0; desired_torque_last = 0; rt_torque_last = 0; ts_last = 0;