From cd0400eb550556c87dd0991840e3173b7defa416 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Tue, 15 Aug 2023 01:18:23 -0400 Subject: [PATCH] Readability --- board/safety/safety_hyundai.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/board/safety/safety_hyundai.h b/board/safety/safety_hyundai.h index 2f332bbe437..4d37c8c8785 100644 --- a/board/safety/safety_hyundai.h +++ b/board/safety/safety_hyundai.h @@ -256,6 +256,20 @@ static int hyundai_tx_hook(CANPacket_t *to_send) { tx = msg_allowed(to_send, HYUNDAI_TX_MSGS, sizeof(HYUNDAI_TX_MSGS)/sizeof(HYUNDAI_TX_MSGS[0])); } + if (hyundai_longitudinal) { + if (hyundai_camera_scc) { + tx = msg_allowed(to_send, HYUNDAI_CAMERA_SCC_LONG_TX_MSGS, sizeof(HYUNDAI_CAMERA_SCC_LONG_TX_MSGS)/sizeof(HYUNDAI_CAMERA_SCC_LONG_TX_MSGS[0])); + } else { + tx = msg_allowed(to_send, HYUNDAI_LONG_TX_MSGS, sizeof(HYUNDAI_LONG_TX_MSGS)/sizeof(HYUNDAI_LONG_TX_MSGS[0])); + } + } else { + if (hyundai_camera_scc) { + tx = msg_allowed(to_send, HYUNDAI_CAMERA_SCC_TX_MSGS, sizeof(HYUNDAI_CAMERA_SCC_TX_MSGS)/sizeof(HYUNDAI_CAMERA_SCC_TX_MSGS[0])); + } else { + tx = msg_allowed(to_send, HYUNDAI_TX_MSGS, sizeof(HYUNDAI_TX_MSGS)/sizeof(HYUNDAI_TX_MSGS[0])); + } + } + // FCA11: Block any potential actuation if (addr == 909) { int CR_VSM_DecCmd = GET_BYTE(to_send, 1);