@@ -109,21 +109,13 @@ AddrCheckStruct subaru_gen2_addr_checks[] = {
109109#define SUBARU_GEN2_ADDR_CHECK_LEN (sizeof(subaru_gen2_addr_checks) / sizeof(subaru_gen2_addr_checks[0]))
110110addr_checks subaru_gen2_rx_checks = {subaru_gen2_addr_checks , SUBARU_GEN2_ADDR_CHECK_LEN };
111111
112- AddrCheckStruct subaru_es_status_addr_checks [] = {
113- SUBARU_COMMON_ADDR_CHECKS (SUBARU_MAIN_BUS )
114- {.msg = {{MSG_SUBARU_ES_Status , 2 , 8 , .check_checksum = true, .max_counter = 15U , .expected_timestep = 50000U }, { 0 }, { 0 }}},
115- };
116- #define SUBARU_ES_STATUS_ADDR_CHECK_LEN (sizeof(subaru_es_status_addr_checks) / sizeof(subaru_es_status_addr_checks[0]))
117-
118112const uint16_t SUBARU_PARAM_GEN2 = 1 ;
119113const uint16_t SUBARU_PARAM_LONGITUDINAL = 2 ;
120114const uint16_t SUBARU_PARAM_LKAS_ANGLE = 4 ;
121- const uint16_t SUBARU_PARAM_ES_STATUS = 8 ;
122115
123116bool subaru_gen2 = false;
124117bool subaru_longitudinal = false;
125118bool lkas_angle = false;
126- bool es_status = false;
127119
128120
129121static uint32_t subaru_get_checksum (CANPacket_t * to_push ) {
@@ -152,7 +144,6 @@ static int subaru_rx_hook(CANPacket_t *to_push) {
152144 if (valid ) {
153145 const int bus = GET_BUS (to_push );
154146 const int alt_main_bus = subaru_gen2 ? SUBARU_ALT_BUS : SUBARU_MAIN_BUS ;
155- const int alt_cam_bus = subaru_gen2 ? SUBARU_ALT_BUS : SUBARU_CAM_BUS ;
156147 const int stock_ecu = lkas_angle ? MSG_SUBARU_ES_LKAS_ANGLE : MSG_SUBARU_ES_LKAS ;
157148
158149 int addr = GET_ADDR (to_push );
@@ -169,16 +160,11 @@ static int subaru_rx_hook(CANPacket_t *to_push) {
169160 }
170161
171162 // enter controls on rising edge of ACC, exit controls on ACC off
172- if ((addr == MSG_SUBARU_CruiseControl ) && (bus == alt_main_bus ) && ! es_status ) {
163+ if ((addr == MSG_SUBARU_CruiseControl ) && (bus == alt_main_bus )) {
173164 bool cruise_engaged = GET_BIT (to_push , 41U ) != 0U ;
174165 pcm_cruise_check (cruise_engaged );
175166 }
176167
177- if ((addr == MSG_SUBARU_ES_Status ) && (bus == alt_cam_bus ) && es_status ) {
178- bool cruise_engaged = GET_BIT (to_push , 29U ) != 0U ;
179- pcm_cruise_check (cruise_engaged );
180- }
181-
182168 // update vehicle moving with any non-zero wheel speed
183169 if ((addr == MSG_SUBARU_Wheel_Speeds ) && (bus == alt_main_bus )) {
184170 uint32_t fr = (GET_BYTES (to_push , 1 , 3 ) >> 4 ) & 0x1FFFU ;
@@ -309,13 +295,10 @@ static const addr_checks* subaru_init(uint16_t param) {
309295#ifdef ALLOW_DEBUG
310296 subaru_longitudinal = GET_FLAG (param , SUBARU_PARAM_LONGITUDINAL ) && !subaru_gen2 ;
311297 lkas_angle = GET_FLAG (param , SUBARU_PARAM_LKAS_ANGLE ) && !subaru_gen2 ;
312- es_status = GET_FLAG (param , SUBARU_PARAM_ES_STATUS ) && !subaru_gen2 ;
313298#endif
314299
315300 if (subaru_gen2 ) {
316301 subaru_rx_checks = (addr_checks ){subaru_gen2_addr_checks , SUBARU_GEN2_ADDR_CHECK_LEN };
317- } else if (es_status ) {
318- subaru_rx_checks = (addr_checks ){subaru_es_status_addr_checks , SUBARU_ES_STATUS_ADDR_CHECK_LEN };
319302 } else {
320303 subaru_rx_checks = (addr_checks ){subaru_addr_checks , SUBARU_ADDR_CHECK_LEN };
321304 }
0 commit comments