|
24 | 24 | #define TOYOTA_COMMON_RX_CHECKS(lta) \
|
25 | 25 | {.msg = {{ 0xaa, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 83U}, { 0 }, { 0 }}}, \
|
26 | 26 | {.msg = {{0x260, 0, 8, .ignore_counter = true, .quality_flag = (lta), .frequency = 50U}, { 0 }, { 0 }}}, \
|
27 |
| - {.msg = {{0x1D2, 0, 8, .ignore_counter = true, .frequency = 33U}, \ |
28 |
| - {0x176, 0, 8, .ignore_counter = true, .frequency = 32U}, { 0 }}}, \ |
29 |
| - {.msg = {{0x101, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 50U}, \ |
30 |
| - {0x224, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 40U}, \ |
31 |
| - {0x226, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 40U}}}, \ |
| 27 | + |
| 28 | +#define TOYOTA_RX_CHECKS(lta) \ |
| 29 | + TOYOTA_COMMON_RX_CHECKS(lta) \ |
| 30 | + {.msg = {{0x1D2, 0, 8, .ignore_counter = true, .frequency = 33U}, { 0 }, { 0 }}}, \ |
| 31 | + {.msg = {{0x224, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 40U}, \ |
| 32 | + {0x226, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 40U}, { 0 }}}, \ |
| 33 | + |
| 34 | +#define TOYOTA_SECOC_RX_CHECKS \ |
| 35 | + TOYOTA_COMMON_RX_CHECKS(false) \ |
| 36 | + {.msg = {{0x176, 0, 8, .ignore_counter = true, .frequency = 32U}, { 0 }, { 0 }}}, \ |
| 37 | + {.msg = {{0x116, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 42U}, { 0 }, { 0 }}}, \ |
| 38 | + {.msg = {{0x101, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 50U}, { 0 }, { 0 }}}, \ |
32 | 39 |
|
33 | 40 | static bool toyota_secoc = false;
|
34 | 41 | static bool toyota_alt_brake = false;
|
@@ -360,16 +367,22 @@ static safety_config toyota_init(uint16_t param) {
|
360 | 367 | SET_TX_MSGS(TOYOTA_LONG_TX_MSGS, ret);
|
361 | 368 | }
|
362 | 369 |
|
363 |
| - if (toyota_lta) { |
| 370 | + if (toyota_secoc) { |
| 371 | + static RxCheck toyota_secoc_rx_checks[] = { |
| 372 | + TOYOTA_SECOC_RX_CHECKS |
| 373 | + }; |
| 374 | + |
| 375 | + SET_RX_CHECKS(toyota_secoc_rx_checks, ret); |
| 376 | + } else if (toyota_lta) { |
364 | 377 | // Check the quality flag for angle measurement when using LTA, since it's not set on TSS-P cars
|
365 | 378 | static RxCheck toyota_lta_rx_checks[] = {
|
366 |
| - TOYOTA_COMMON_RX_CHECKS(true) |
| 379 | + TOYOTA_RX_CHECKS(true) |
367 | 380 | };
|
368 | 381 |
|
369 | 382 | SET_RX_CHECKS(toyota_lta_rx_checks, ret);
|
370 | 383 | } else {
|
371 | 384 | static RxCheck toyota_lka_rx_checks[] = {
|
372 |
| - TOYOTA_COMMON_RX_CHECKS(false) |
| 385 | + TOYOTA_RX_CHECKS(false) |
373 | 386 | };
|
374 | 387 |
|
375 | 388 | SET_RX_CHECKS(toyota_lka_rx_checks, ret);
|
|
0 commit comments