mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-18 17:23:52 +08:00
Hyundai CAN FD: fix boolean types in fwd hook (#1620)
* Safety: Utilize boolean values for message block checks in forward hooks * Revert "Safety: Utilize boolean values for message block checks in forward hooks" This reverts commit ee9809dbd3c4fe30b8b5d852e3aa3dbcf56d02b2. * others * Revert "others" This reverts commit f64cc1c76a6b6d073805f3dcaddb25244830857a. * just do hyundai * function to get steering address * unclear if this is cleaner Revert "function to get steering address" This reverts commit 2a2b972a20062fbd84f1f569e18ac197aa6da8c9. --------- Co-authored-by: Shane Smiskol <shane@smiskol.com>
This commit is contained in:
@@ -320,16 +320,16 @@ static int hyundai_canfd_fwd_hook(int bus_num, int addr) {
|
||||
}
|
||||
if (bus_num == 2) {
|
||||
// LKAS for HDA2, LFA for HDA1
|
||||
int is_lkas_msg = (((addr == 0x50) || (addr == 0x2a4)) && hyundai_canfd_hda2);
|
||||
int is_lfa_msg = ((addr == 0x12a) && !hyundai_canfd_hda2);
|
||||
bool is_lkas_msg = (((addr == 0x50) || (addr == 0x2a4)) && hyundai_canfd_hda2);
|
||||
bool is_lfa_msg = ((addr == 0x12a) && !hyundai_canfd_hda2);
|
||||
|
||||
// HUD icons
|
||||
int is_lfahda_msg = ((addr == 0x1e0) && !hyundai_canfd_hda2);
|
||||
bool is_lfahda_msg = ((addr == 0x1e0) && !hyundai_canfd_hda2);
|
||||
|
||||
// CRUISE_INFO for non-HDA2, we send our own longitudinal commands
|
||||
int is_scc_msg = ((addr == 0x1a0) && hyundai_longitudinal && !hyundai_canfd_hda2);
|
||||
bool is_scc_msg = ((addr == 0x1a0) && hyundai_longitudinal && !hyundai_canfd_hda2);
|
||||
|
||||
int block_msg = is_lkas_msg || is_lfa_msg || is_lfahda_msg || is_scc_msg;
|
||||
bool block_msg = is_lkas_msg || is_lfa_msg || is_lfahda_msg || is_scc_msg;
|
||||
if (!block_msg) {
|
||||
bus_fwd = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user