Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HKG: ccNC port #2107

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion board/safety/safety_hyundai_canfd.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ static int hyundai_canfd_fwd_hook(int bus_num, int addr) {
// CRUISE_INFO for non-HDA2, we send our own longitudinal commands
bool is_scc_msg = ((addr == 0x1a0) && hyundai_longitudinal && !hyundai_canfd_hda2);

bool block_msg = is_lkas_msg || is_lfa_msg || is_lfahda_msg || is_scc_msg;
bool is_ccnc_msg = (addr == 0x161) || (addr == 0x162);

bool block_msg = is_lkas_msg || is_lfa_msg || is_lfahda_msg || is_scc_msg || is_ccnc_msg;
if (!block_msg) {
bus_fwd = 0;
}
Expand Down Expand Up @@ -261,6 +263,8 @@ static safety_config hyundai_canfd_init(uint16_t param) {
{0x1A0, 0, 32}, // CRUISE_INFO
{0x1CF, 2, 8}, // CRUISE_BUTTON
{0x1E0, 0, 16}, // LFAHDA_CLUSTER
{0x161, 0, 32}, // MSG_161
{0x162, 0, 32}, // MSG_162
};


Expand Down
8 changes: 4 additions & 4 deletions tests/safety/test_hyundai_canfd.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class TestHyundaiCanfdHDA1Base(TestHyundaiCanfdBase):

TX_MSGS = [[0x12A, 0], [0x1A0, 1], [0x1CF, 0], [0x1E0, 0]]
RELAY_MALFUNCTION_ADDRS = {0: (0x12A,)} # LFA
FWD_BLACKLISTED_ADDRS = {2: [0x12A, 0x1E0]}
FWD_BLACKLISTED_ADDRS = {2: [0x12A, 0x1E0, 0x161, 0x162]}
FWD_BUS_LOOKUP = {0: 2, 2: 0}

STEER_MSG = "LFA"
Expand Down Expand Up @@ -160,7 +160,7 @@ class TestHyundaiCanfdHDA2EV(TestHyundaiCanfdBase):

TX_MSGS = [[0x50, 0], [0x1CF, 1], [0x2A4, 0]]
RELAY_MALFUNCTION_ADDRS = {0: (0x50,)} # LKAS
FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4]}
FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4, 0x161, 0x162]}
FWD_BUS_LOOKUP = {0: 2, 2: 0}

PT_BUS = 1
Expand All @@ -180,7 +180,7 @@ class TestHyundaiCanfdHDA2EVAltSteering(TestHyundaiCanfdBase):

TX_MSGS = [[0x110, 0], [0x1CF, 1], [0x362, 0]]
RELAY_MALFUNCTION_ADDRS = {0: (0x110,)} # LKAS_ALT
FWD_BLACKLISTED_ADDRS = {2: [0x110, 0x362]}
FWD_BLACKLISTED_ADDRS = {2: [0x110, 0x362, 0x161, 0x162]}
FWD_BUS_LOOKUP = {0: 2, 2: 0}

PT_BUS = 1
Expand Down Expand Up @@ -233,7 +233,7 @@ def _accel_msg(self, accel, aeb_req=False, aeb_decel=0):
])
class TestHyundaiCanfdHDA1Long(HyundaiLongitudinalBase, TestHyundaiCanfdHDA1Base):

FWD_BLACKLISTED_ADDRS = {2: [0x12a, 0x1e0, 0x1a0]}
FWD_BLACKLISTED_ADDRS = {2: [0x12a, 0x1e0, 0x1a0, 0x161, 0x162]}

RELAY_MALFUNCTION_ADDRS = {0: (0x12A, 0x1a0)} # LFA, SCC_CONTROL

Expand Down
Loading