Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed Apr 11, 2018
1 parent 367c9ad commit 894572c
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tests/safety/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ typedef struct
uint32_t CNT;
} TIM_TypeDef;

struct sample_t torque_meas;

TIM_TypeDef timer;
TIM_TypeDef *TIM2 = &timer;

Expand All @@ -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;
}
Expand All @@ -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){
Expand All @@ -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;
Expand Down

0 comments on commit 894572c

Please sign in to comment.