Skip to content

Commit

Permalink
block lkas2 fwd
Browse files Browse the repository at this point in the history
  • Loading branch information
MoreTore committed Jul 15, 2023
1 parent f8bad49 commit 9e2a216
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions board/safety/safety_mazda.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,13 @@ static int mazda_tx_hook(CANPacket_t *to_send) {

static int mazda_fwd_hook(int bus, int addr) {
int bus_fwd = -1;

bool block = (addr == MAZDA_LKAS2);
if (bus == MAZDA_MAIN) {
bus_fwd = MAZDA_CAM;
if (!block) {
bus_fwd = MAZDA_CAM;
}
} else if (bus == MAZDA_CAM) {
bool block = (addr == MAZDA_LKAS) || (addr == MAZDA_LKAS_HUD);
block |= (addr == MAZDA_LKAS) || (addr == MAZDA_LKAS_HUD);
if (!block) {
bus_fwd = MAZDA_MAIN;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/safety/test_mazda.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TestMazdaSafety(common.PandaSafetyTest, common.DriverTorqueSteeringSafetyT
STANDSTILL_THRESHOLD = .1
RELAY_MALFUNCTION_ADDR = 0x243
RELAY_MALFUNCTION_BUS = 0
FWD_BLACKLISTED_ADDRS = {2: [0x243, 0x440]}
FWD_BLACKLISTED_ADDRS = {0: [0x249,], 2: [0x243, 0x440, 0x249]}
FWD_BUS_LOOKUP = {0: 2, 2: 0}

MAX_RATE_UP = 10
Expand Down

0 comments on commit 9e2a216

Please sign in to comment.