* v2 init

This commit is contained in:
Rick Lan
2018-09-19 09:05:48 +10:00
parent 23126143be
commit c87526ea54
3 changed files with 8 additions and 16 deletions
+4 -7
View File
@@ -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
+2 -7
View File
@@ -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;
}
+2 -2
View File
@@ -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),
]