diff --git a/opendbc/lexus_ave30_2017_pt_generated.dbc b/opendbc/lexus_ave30_2017_pt_generated.dbc index 733f08e17..563176cd6 100644 --- a/opendbc/lexus_ave30_2017_pt_generated.dbc +++ b/opendbc/lexus_ave30_2017_pt_generated.dbc @@ -54,13 +54,6 @@ BO_ 180 SPEED: 8 XXX SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX SG_ SPEED : 47|16@0+ (0.01,0) [0|250] "kph" XXX -BO_ 466 PCM_CRUISE: 8 XXX - SG_ GAS_RELEASED : 4|1@0+ (1,0) [0|1] "" XXX - SG_ STANDSTILL_ON : 12|1@0+ (1,0) [0|1] "" XXX - SG_ ACCEL_NET : 23|16@0- (0.001,0) [-20|20] "m/s2" XXX - SG_ CRUISE_STATE : 55|4@0+ (1,0) [0|15] "" XXX - SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX - BO_ 552 ACCELEROMETER: 8 XXX SG_ ACCEL_Z : 22|15@0- (1,0) [0|32767] "" XXX SG_ ACCEL_X : 6|15@0- (0.001,0) [-20|20] "m/s2" XXX @@ -175,6 +168,10 @@ BO_ 610 EPS_STATUS: 5 EPS BO_ 956 GEAR_PACKET: 8 XXX SG_ GEAR : 13|6@0+ (1,0) [0|63] "" XXX +BO_ 466 PCM_CRUISE: 8 XXX + SG_ GAS_RELEASED : 4|1@0+ (1,0) [0|1] "" XXX + SG_ CRUISE_STATE : 15|3@0+ (1,0) [0|0] "" DS1 + BO_ 1009 PCM_CRUISE_LEXUS_AVE30: 8 XXX SG_ MAIN_ON : 13|1@0+ (1,0) [0|3] "" XXX SG_ CRUISE_STATE : 10|1@0+ (1,0) [0|1] "" XXX diff --git a/panda/board/safety/safety_toyota.h b/panda/board/safety/safety_toyota.h index 78a8a53d9..738fc26a5 100644 --- a/panda/board/safety/safety_toyota.h +++ b/panda/board/safety/safety_toyota.h @@ -30,7 +30,6 @@ uint32_t toyota_ts_last = 0; int toyota_cruise_engaged_last = 0; // cruise state struct sample_t toyota_torque_meas; // last 3 motor torques produced by the eps -uint32_t acc_addr = 0; // acc state address int is_lexus_ave30 = 0; // is a lexus is300h/ave30 model? static void toyota_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) { @@ -50,10 +49,9 @@ static void toyota_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) { } // enter controls on rising edge of ACC, exit controls on ACC off - if ((to_push->RIR>>21) == acc_addr) { - // lexus ave30 1 bit: 11 + if ((to_push->RIR>>21) == 0x1D2) { // toyota: 4 bits: 55-52 - int cruise_engaged = is_lexus_ave30 == 1? to_push->RDLR & 0x400 : to_push->RDHR & 0xF00000; + int cruise_engaged = is_lexus_ave30 == 1? to_push->RDLR & 0x2000 : to_push->RDHR & 0xF00000; if (cruise_engaged && !toyota_cruise_engaged_last) { controls_allowed = 1; } else if (!cruise_engaged) { @@ -154,7 +152,6 @@ static void toyota_init(int16_t param) { toyota_actuation_limits = 1; toyota_giraffe_switch_1 = 0; toyota_dbc_eps_torque_factor = param; - acc_addr = 0x1D2; is_lexus_ave30 = 0; } @@ -163,7 +160,6 @@ static void lexus_ave30_init(int16_t param) { toyota_actuation_limits = 1; toyota_giraffe_switch_1 = 0; toyota_dbc_eps_torque_factor = param; - acc_addr = 0x3F1; is_lexus_ave30 = 1; } @@ -192,7 +188,6 @@ static void toyota_nolimits_init(int16_t param) { toyota_actuation_limits = 0; toyota_giraffe_switch_1 = 0; toyota_dbc_eps_torque_factor = param; - acc_addr = 0x1D2; is_lexus_ave30 = 0; } diff --git a/selfdrive/car/toyota/carstate.py b/selfdrive/car/toyota/carstate.py index 925c90b43..8ad2d32cd 100644 --- a/selfdrive/car/toyota/carstate.py +++ b/selfdrive/car/toyota/carstate.py @@ -43,9 +43,9 @@ def get_can_parser(CP): if CP.carFingerprint == CAR.LEXUS_AVE30: signals += [ - ("BRAKE_PRESSED", "BRAKE_MODULE2", 0), + ("BRAKE_PRESSED", "BRAKE_MODULE", 0), ("GAS_RELEASED", "PCM_CRUISE", 0), - ("CRUISE_STATE", "PCM_CRUISE_LEXUS_AVE30", 0), + ("CRUISE_STATE", "PCM_CRUISE", 0), ("MAIN_ON", "PCM_CRUISE_LEXUS_AVE30", 0), ("SET_SPEED", "PCM_CRUISE_LEXUS_AVE30", 0), ]