safety tests: clean up state reset (#1703)

* this is already reset in set_safety_hooks

* move these car-specific variables into their own init hooks
This commit is contained in:
Shane Smiskol 2023-10-31 21:19:55 -07:00 committed by GitHub
parent 120ea2c5bb
commit bc69d25335
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 6 deletions

View File

@ -377,8 +377,9 @@ static int honda_tx_hook(CANPacket_t *to_send) {
}
static const addr_checks* honda_nidec_init(uint16_t param) {
gas_interceptor_detected = 0;
honda_hw = HONDA_NIDEC;
honda_brake = 0;
honda_fwd_brake = false;
honda_alt_brake_msg = false;
honda_bosch_long = false;
honda_bosch_radarless = false;

View File

@ -226,6 +226,8 @@ static const addr_checks* tesla_init(uint16_t param) {
tesla_powertrain = GET_FLAG(param, TESLA_FLAG_POWERTRAIN);
tesla_longitudinal = GET_FLAG(param, TESLA_FLAG_LONGITUDINAL_CONTROL);
tesla_stock_aeb = false;
return tesla_powertrain ? (&tesla_pt_rx_checks) : (&tesla_rx_checks);
}

View File

@ -222,7 +222,6 @@ static int toyota_tx_hook(CANPacket_t *to_send) {
}
static const addr_checks* toyota_init(uint16_t param) {
gas_interceptor_detected = 0;
toyota_alt_brake = GET_FLAG(param, TOYOTA_PARAM_ALT_BRAKE);
toyota_stock_longitudinal = GET_FLAG(param, TOYOTA_PARAM_STOCK_LONGITUDINAL);
toyota_dbc_eps_torque_factor = param & TOYOTA_EPS_FACTOR;

View File

@ -187,10 +187,6 @@ void init_tests(void){
ts_steer_req_mismatch_last = 0;
valid_steer_req_count = 0;
invalid_steer_req_count = 0;
// car-specific stuff
honda_fwd_brake = false;
tesla_stock_aeb = false;
}
void set_gmlan_digital_output(int to_set){