gen2 only

This commit is contained in:
Justin Newberry 2023-04-13 13:28:03 +00:00
parent 00339119e7
commit 6a511a9976
2 changed files with 8 additions and 6 deletions

View File

@ -24,8 +24,7 @@ const CanMsg SUBARU_TX_MSGS[] = {
{0x122, 0, 8},
{0x221, 0, 8},
{0x321, 0, 8},
{0x322, 0, 8},
{0x323, 0, 8},
{0x322, 0, 8}
};
#define SUBARU_TX_MSGS_LEN (sizeof(SUBARU_TX_MSGS) / sizeof(SUBARU_TX_MSGS[0]))
@ -160,8 +159,11 @@ static int subaru_fwd_hook(int bus_num, int addr) {
// 0x321 ES_DashStatus
// 0x322 ES_LKAS_State
// 0x323 INFOTAINMENT_STATUS
bool block_lkas = (addr == 0x122) || (addr == 0x321) || (addr == 0x322) || (addr == 0x323);
if (!block_lkas) {
bool block_infotainment = subaru_gen2 && (addr == 0x323);
bool block_lkas = (addr == 0x122) || (addr == 0x321) || (addr == 0x322);
bool block_addr = block_infotainment || block_lkas;
if (!block_addr) {
bus_fwd = 0; // Main CAN
}
}

View File

@ -7,11 +7,11 @@ from panda.tests.safety.common import CANPackerPanda
class TestSubaruSafety(common.PandaSafetyTest, common.DriverTorqueSteeringSafetyTest):
TX_MSGS = [[0x122, 0], [0x221, 0], [0x321, 0], [0x322, 0], [0x323, 0]]
TX_MSGS = [[0x122, 0], [0x221, 0], [0x321, 0], [0x322, 0]]
STANDSTILL_THRESHOLD = 0 # kph
RELAY_MALFUNCTION_ADDR = 0x122
RELAY_MALFUNCTION_BUS = 0
FWD_BLACKLISTED_ADDRS = {2: [0x122, 0x321, 0x322, 0x323]}
FWD_BLACKLISTED_ADDRS = {2: [0x122, 0x321, 0x322]}
FWD_BUS_LOOKUP = {0: 2, 2: 0}
MAX_RATE_UP = 50