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: Car Port for Genesis G70 2024 #2045

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
13 changes: 11 additions & 2 deletions board/safety/safety_hyundai.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,16 @@ static int hyundai_fwd_hook(int bus_num, int addr) {
if (bus_num == 0) {
bus_fwd = 2;
}
if ((bus_num == 2) && (addr != 0x340) && (addr != 0x485)) {
bus_fwd = 0;

if (bus_num == 2) {
bool is_lkas_11 = (addr == 0x340);
bool is_hda11_mfc = (addr == 0x484) && hyundai_camera_scc && !hyundai_longitudinal;
bool is_lfahda_mfc = (addr == 0x485);

bool block_msg = is_lkas_11 || is_hda11_mfc || is_lfahda_mfc;
if (!block_msg) {
bus_fwd = 0;
}
}

return bus_fwd;
Expand All @@ -275,6 +283,7 @@ static safety_config hyundai_init(uint16_t param) {
static const CanMsg HYUNDAI_CAMERA_SCC_TX_MSGS[] = {
{0x340, 0, 8}, // LKAS11 Bus 0
{0x4F1, 2, 4}, // CLU11 Bus 2
{0x484, 0, 8}, // HDA11_MFC Bus 0
{0x485, 0, 4}, // LFAHDA_MFC Bus 0
};

Expand Down
3 changes: 3 additions & 0 deletions tests/safety/test_hyundai.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ class TestHyundaiSafetyCameraSCC(TestHyundaiSafety):
BUTTONS_TX_BUS = 2 # tx on 2, rx on 0
SCC_BUS = 2 # rx on 2

TX_MSGS = [[0x340, 0], [0x4F1, 0], [0x484, 0], [0x485, 0]]
FWD_BLACKLISTED_ADDRS = {2: [0x340, 0x484, 0x485]}

def setUp(self):
self.packer = CANPackerPanda("hyundai_kia_generic")
self.safety = libpanda_py.libpanda
Expand Down
Loading