From 48632d9e0baebeb200f06a7e19db2cf0686abd4c Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Tue, 29 Aug 2023 23:23:41 -0400 Subject: [PATCH] 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 --- board/safety/safety_hyundai_canfd.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/board/safety/safety_hyundai_canfd.h b/board/safety/safety_hyundai_canfd.h index fa6bf0b6..2fcea529 100644 --- a/board/safety/safety_hyundai_canfd.h +++ b/board/safety/safety_hyundai_canfd.h @@ -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; }