@@ -237,6 +237,8 @@ static safety_config hyundai_canfd_init(uint16_t param) {
237237 static const CanMsg HYUNDAI_CANFD_HDA2_ALT_STEERING_TX_MSGS [] = {
238238 {0x110 , 0 , 32 }, // LKAS_ALT
239239 {0x1CF , 1 , 8 }, // CRUISE_BUTTON
240+ // Needed for cruise control in case of ALT_BUTTONS.
241+ {0x1A0 , 1 , 32 }, // CRUISE_INFO
240242 {0x362 , 0 , 32 }, // CAM_0x362
241243 };
242244
@@ -303,15 +305,23 @@ static safety_config hyundai_canfd_init(uint16_t param) {
303305 if (hyundai_canfd_hda2 ) {
304306 // *** HDA2 checks ***
305307 // E-CAN is on bus 1, ADAS unit sends SCC messages on HDA2.
306- // Does not use the alt buttons message
307- static RxCheck hyundai_canfd_hda2_rx_checks [] = {
308- HYUNDAI_CANFD_COMMON_RX_CHECKS (1 )
309- HYUNDAI_CANFD_BUTTONS_ADDR_CHECK (1 )
310- HYUNDAI_CANFD_SCC_ADDR_CHECK (1 )
311- };
312-
313- ret = hyundai_canfd_hda2_alt_steering ? BUILD_SAFETY_CFG (hyundai_canfd_hda2_rx_checks , HYUNDAI_CANFD_HDA2_ALT_STEERING_TX_MSGS ) : \
314- BUILD_SAFETY_CFG (hyundai_canfd_hda2_rx_checks , HYUNDAI_CANFD_HDA2_TX_MSGS );
308+ if (hyundai_canfd_alt_buttons ) {
309+ static RxCheck hyundai_canfd_hda2_alt_buttons_rx_checks [] = {
310+ HYUNDAI_CANFD_COMMON_RX_CHECKS (1 )
311+ HYUNDAI_CANFD_ALT_BUTTONS_ADDR_CHECK (1 )
312+ HYUNDAI_CANFD_SCC_ADDR_CHECK (1 )
313+ };
314+ ret = hyundai_canfd_hda2_alt_steering ? BUILD_SAFETY_CFG (hyundai_canfd_hda2_alt_buttons_rx_checks , HYUNDAI_CANFD_HDA2_ALT_STEERING_TX_MSGS ) : \
315+ BUILD_SAFETY_CFG (hyundai_canfd_hda2_alt_buttons_rx_checks , HYUNDAI_CANFD_HDA2_TX_MSGS );
316+ } else {
317+ static RxCheck hyundai_canfd_hda2_rx_checks [] = {
318+ HYUNDAI_CANFD_COMMON_RX_CHECKS (1 )
319+ HYUNDAI_CANFD_BUTTONS_ADDR_CHECK (1 )
320+ HYUNDAI_CANFD_SCC_ADDR_CHECK (1 )
321+ };
322+ ret = hyundai_canfd_hda2_alt_steering ? BUILD_SAFETY_CFG (hyundai_canfd_hda2_rx_checks , HYUNDAI_CANFD_HDA2_ALT_STEERING_TX_MSGS ) : \
323+ BUILD_SAFETY_CFG (hyundai_canfd_hda2_rx_checks , HYUNDAI_CANFD_HDA2_TX_MSGS );
324+ }
315325 } else if (!hyundai_camera_scc ) {
316326 static RxCheck hyundai_canfd_radar_scc_alt_buttons_rx_checks [] = {
317327 HYUNDAI_CANFD_COMMON_RX_CHECKS (0 )
0 commit comments