diff --git a/opendbc_repo/opendbc/safety/modes/hyundai_canfd.h b/opendbc_repo/opendbc/safety/modes/hyundai_canfd.h index a6ec624e7d..339f85c2d4 100644 --- a/opendbc_repo/opendbc/safety/modes/hyundai_canfd.h +++ b/opendbc_repo/opendbc/safety/modes/hyundai_canfd.h @@ -1288,18 +1288,7 @@ static bool hyundai_kona_camera_fwd(const CANPacket_t *msg) { } #endif -static bool hyundai_canfd_tx_hook(const CANPacket_t *msg) { -#ifdef ALLOW_DEBUG - if (hyundai_kona_idle_handoff && (msg->addr == 0x12AU)) { - const uint32_t now = microsecond_timer_get(); - if (safety_rx_checks_invalid || !aol_rx_healthy() || !hyundai_kona_host_steering() || - !hyundai_kona_lfa_valid(msg) || !hyundai_kona_camera_seen || - (safety_get_ts_elapsed(now, hyundai_kona_camera_ts) > 50000U) || - (msg->data[2] != hyundai_kona_camera_counter) || !hyundai_kona_output_ready(now, true, msg->data[2])) { - return false; - } - } -#endif +static bool hyundai_canfd_tx_hook_checked(const CANPacket_t *msg) { bool tx = false; const bool ordinary_angle_frame = hyundai_ordinary_angle_stock && ((msg->addr == 0x110U) || (msg->addr == 0x362U)); bool ordinary_angle_valid = true; @@ -1367,6 +1356,24 @@ static bool hyundai_canfd_tx_hook(const CANPacket_t *msg) { return tx; } +static bool hyundai_canfd_tx_hook(const CANPacket_t *msg) { +#ifdef ALLOW_DEBUG + bool allowed = true; + if (hyundai_kona_idle_handoff && (msg->addr == 0x12AU)) { + const uint32_t now = microsecond_timer_get(); + allowed = !safety_rx_checks_invalid && aol_rx_healthy() && hyundai_kona_host_steering() && + hyundai_kona_lfa_valid(msg) && hyundai_kona_camera_seen && + (safety_get_ts_elapsed(now, hyundai_kona_camera_ts) <= 50000U) && + (msg->data[2] == hyundai_kona_camera_counter) && hyundai_kona_output_ready(now, true, msg->data[2]); + } +#endif + return +#ifdef ALLOW_DEBUG + allowed && +#endif + hyundai_canfd_tx_hook_checked(msg); +} + static void hyundai_canfd_reset_ioniq6_state(void) { hyundai_canfd_ioniq6_long = false; aol_ioniq6_long = false; @@ -2314,37 +2321,32 @@ static safety_config hyundai_canfd_init_validated(uint16_t supplied_param) { return ret; } -static safety_config hyundai_canfd_init(uint16_t param) { +static safety_config hyundai_canfd_init(uint16_t raw_param) { hyundai_daw_init(true, false); hyundai_canfd_reset_ioniq6_state(); hyundai_ordinary_angle_reset(); #ifdef ALLOW_DEBUG - hyundai_kona_idle_handoff = (param == 0x1C0CU) && (alternative_experience == 32); + hyundai_kona_idle_handoff = (raw_param == 0x1C0CU) && (alternative_experience == 32); hyundai_kona_camera_seen = false; hyundai_kona_output_seen = false; - if ((param == 0x1C0CU) && !hyundai_kona_idle_handoff) { - return (safety_config){.disable_forwarding = true}; - } - if (hyundai_kona_idle_handoff) { - param = 0x0C0CU; - } + const bool kona_profile_valid = (raw_param != 0x1C0CU) || hyundai_kona_idle_handoff; + const uint16_t param = hyundai_kona_idle_handoff ? 0x0C0CU : raw_param; const bool valid = !GET_FLAG(param, 32768U) || (param == 0x8015U) || (param == 0x8095U) || (param == 0x8815U) || (param == 0x8895U) || hyundai_canfd_gv60_long_param(param); #else - if (param == 0x1C0CU) { - return (safety_config){.disable_forwarding = true}; - } + const bool kona_profile_valid = raw_param != 0x1C0CU; + const uint16_t param = raw_param; const bool valid = !GET_FLAG(param, 32768U); #endif - safety_config ret = {0}; + safety_config ret = {.disable_forwarding = !kona_profile_valid}; const bool marker_valid = GET_FLAG(param, 16384U) || !GET_FLAG(param, 2048U) || hyundai_canfd_stock_torque_aol_param(param) || #ifdef ALLOW_DEBUG (hyundai_canfd_torque_long_aol_param(param) && ((unsigned int)alternative_experience == 32U)) || #endif (param == 0x8815U) || (param == 0x8895U); - if (valid && marker_valid) { + if (kona_profile_valid && valid && marker_valid) { ret = hyundai_canfd_init_validated(param); const bool daw_profile = (param == 0x0011U) || (param == 0x0091U) || (param == 0x0811U) || (param == 0x0891U) || (param == 0x8015U) || (param == 0x8095U) || (param == 0x8815U) || (param == 0x8895U); @@ -2355,7 +2357,7 @@ static safety_config hyundai_canfd_init(uint16_t param) { if (hyundai_canfd_angle_aol_capacity(&ret)) { for (int i = 0; i < ret.tx_msgs_len; i++) { kona_tx[i] = ret.tx_msgs[i]; - if (kona_tx[i].addr == 0x12AU) { + if (kona_tx[i].addr == 0x12A) { kona_tx[i].disable_static_blocking = true; } } diff --git a/openpilot/selfdrive/pandad/pandad b/openpilot/selfdrive/pandad/pandad index bfa77dbc3f..1eee3b6ac7 100755 Binary files a/openpilot/selfdrive/pandad/pandad and b/openpilot/selfdrive/pandad/pandad differ diff --git a/panda/board/obj/body_h7.bin.signed b/panda/board/obj/body_h7.bin.signed index b60966ab94..c740f1312f 100644 Binary files a/panda/board/obj/body_h7.bin.signed and b/panda/board/obj/body_h7.bin.signed differ diff --git a/panda/board/obj/bootstub.body_h7.bin b/panda/board/obj/bootstub.body_h7.bin index 1fadbd3291..2ffdd921b7 100644 Binary files a/panda/board/obj/bootstub.body_h7.bin and b/panda/board/obj/bootstub.body_h7.bin differ diff --git a/panda/board/obj/bootstub.panda.bin b/panda/board/obj/bootstub.panda.bin index 82d7386584..d16b31706b 100644 Binary files a/panda/board/obj/bootstub.panda.bin and b/panda/board/obj/bootstub.panda.bin differ diff --git a/panda/board/obj/bootstub.panda_can_ignition_only.bin b/panda/board/obj/bootstub.panda_can_ignition_only.bin index 82d7386584..d16b31706b 100644 Binary files a/panda/board/obj/bootstub.panda_can_ignition_only.bin and b/panda/board/obj/bootstub.panda_can_ignition_only.bin differ diff --git a/panda/board/obj/bootstub.panda_h7.bin b/panda/board/obj/bootstub.panda_h7.bin index 02759de5a7..e24d7fbac3 100644 Binary files a/panda/board/obj/bootstub.panda_h7.bin and b/panda/board/obj/bootstub.panda_h7.bin differ diff --git a/panda/board/obj/bootstub.panda_h7_can_ignition_only.bin b/panda/board/obj/bootstub.panda_h7_can_ignition_only.bin index 02759de5a7..e24d7fbac3 100644 Binary files a/panda/board/obj/bootstub.panda_h7_can_ignition_only.bin and b/panda/board/obj/bootstub.panda_h7_can_ignition_only.bin differ diff --git a/panda/board/obj/bootstub.panda_h7_hkg_remote.bin b/panda/board/obj/bootstub.panda_h7_hkg_remote.bin index 02759de5a7..e24d7fbac3 100644 Binary files a/panda/board/obj/bootstub.panda_h7_hkg_remote.bin and b/panda/board/obj/bootstub.panda_h7_hkg_remote.bin differ diff --git a/panda/board/obj/bootstub.panda_h7_hkg_remote_can_ignition_only.bin b/panda/board/obj/bootstub.panda_h7_hkg_remote_can_ignition_only.bin index 02759de5a7..e24d7fbac3 100644 Binary files a/panda/board/obj/bootstub.panda_h7_hkg_remote_can_ignition_only.bin and b/panda/board/obj/bootstub.panda_h7_hkg_remote_can_ignition_only.bin differ diff --git a/panda/board/obj/bootstub.panda_h7_remote.bin b/panda/board/obj/bootstub.panda_h7_remote.bin index 02759de5a7..e24d7fbac3 100644 Binary files a/panda/board/obj/bootstub.panda_h7_remote.bin and b/panda/board/obj/bootstub.panda_h7_remote.bin differ diff --git a/panda/board/obj/bootstub.panda_h7_remote_can_ignition_only.bin b/panda/board/obj/bootstub.panda_h7_remote_can_ignition_only.bin index 02759de5a7..e24d7fbac3 100644 Binary files a/panda/board/obj/bootstub.panda_h7_remote_can_ignition_only.bin and b/panda/board/obj/bootstub.panda_h7_remote_can_ignition_only.bin differ diff --git a/panda/board/obj/bootstub.panda_h7_tesla_wake.bin b/panda/board/obj/bootstub.panda_h7_tesla_wake.bin index 02759de5a7..e24d7fbac3 100644 Binary files a/panda/board/obj/bootstub.panda_h7_tesla_wake.bin and b/panda/board/obj/bootstub.panda_h7_tesla_wake.bin differ diff --git a/panda/board/obj/bootstub.panda_h7_tesla_wake_can_ignition_only.bin b/panda/board/obj/bootstub.panda_h7_tesla_wake_can_ignition_only.bin index 02759de5a7..e24d7fbac3 100644 Binary files a/panda/board/obj/bootstub.panda_h7_tesla_wake_can_ignition_only.bin and b/panda/board/obj/bootstub.panda_h7_tesla_wake_can_ignition_only.bin differ diff --git a/panda/board/obj/bootstub.panda_hkg_remote.bin b/panda/board/obj/bootstub.panda_hkg_remote.bin index 82d7386584..d16b31706b 100644 Binary files a/panda/board/obj/bootstub.panda_hkg_remote.bin and b/panda/board/obj/bootstub.panda_hkg_remote.bin differ diff --git a/panda/board/obj/bootstub.panda_hkg_remote_can_ignition_only.bin b/panda/board/obj/bootstub.panda_hkg_remote_can_ignition_only.bin index 82d7386584..d16b31706b 100644 Binary files a/panda/board/obj/bootstub.panda_hkg_remote_can_ignition_only.bin and b/panda/board/obj/bootstub.panda_hkg_remote_can_ignition_only.bin differ diff --git a/panda/board/obj/bootstub.panda_remote.bin b/panda/board/obj/bootstub.panda_remote.bin index 82d7386584..d16b31706b 100644 Binary files a/panda/board/obj/bootstub.panda_remote.bin and b/panda/board/obj/bootstub.panda_remote.bin differ diff --git a/panda/board/obj/bootstub.panda_remote_can_ignition_only.bin b/panda/board/obj/bootstub.panda_remote_can_ignition_only.bin index 82d7386584..d16b31706b 100644 Binary files a/panda/board/obj/bootstub.panda_remote_can_ignition_only.bin and b/panda/board/obj/bootstub.panda_remote_can_ignition_only.bin differ diff --git a/panda/board/obj/bootstub.panda_tesla_wake.bin b/panda/board/obj/bootstub.panda_tesla_wake.bin index 82d7386584..d16b31706b 100644 Binary files a/panda/board/obj/bootstub.panda_tesla_wake.bin and b/panda/board/obj/bootstub.panda_tesla_wake.bin differ diff --git a/panda/board/obj/bootstub.panda_tesla_wake_can_ignition_only.bin b/panda/board/obj/bootstub.panda_tesla_wake_can_ignition_only.bin index 82d7386584..d16b31706b 100644 Binary files a/panda/board/obj/bootstub.panda_tesla_wake_can_ignition_only.bin and b/panda/board/obj/bootstub.panda_tesla_wake_can_ignition_only.bin differ diff --git a/panda/board/obj/panda.bin.signed b/panda/board/obj/panda.bin.signed index 61e3cd6571..c7e915bed6 100644 Binary files a/panda/board/obj/panda.bin.signed and b/panda/board/obj/panda.bin.signed differ diff --git a/panda/board/obj/panda_can_ignition_only.bin.signed b/panda/board/obj/panda_can_ignition_only.bin.signed index 6ccc3b7dbc..bf78c2345a 100644 Binary files a/panda/board/obj/panda_can_ignition_only.bin.signed and b/panda/board/obj/panda_can_ignition_only.bin.signed differ diff --git a/panda/board/obj/panda_h7.bin.signed b/panda/board/obj/panda_h7.bin.signed index f3c79cf52e..3f4d66ae0b 100644 Binary files a/panda/board/obj/panda_h7.bin.signed and b/panda/board/obj/panda_h7.bin.signed differ diff --git a/panda/board/obj/panda_h7_can_ignition_only.bin.signed b/panda/board/obj/panda_h7_can_ignition_only.bin.signed index 187aa330d3..55813a9eb9 100644 Binary files a/panda/board/obj/panda_h7_can_ignition_only.bin.signed and b/panda/board/obj/panda_h7_can_ignition_only.bin.signed differ diff --git a/panda/board/obj/panda_h7_hkg_remote.bin.signed b/panda/board/obj/panda_h7_hkg_remote.bin.signed index 687a6d7a41..c66706baaa 100644 Binary files a/panda/board/obj/panda_h7_hkg_remote.bin.signed and b/panda/board/obj/panda_h7_hkg_remote.bin.signed differ diff --git a/panda/board/obj/panda_h7_hkg_remote_can_ignition_only.bin.signed b/panda/board/obj/panda_h7_hkg_remote_can_ignition_only.bin.signed index bcb6f3b2c6..0559f2b76f 100644 Binary files a/panda/board/obj/panda_h7_hkg_remote_can_ignition_only.bin.signed and b/panda/board/obj/panda_h7_hkg_remote_can_ignition_only.bin.signed differ diff --git a/panda/board/obj/panda_h7_remote.bin.signed b/panda/board/obj/panda_h7_remote.bin.signed index 85eb37a3a7..7f6f78326b 100644 Binary files a/panda/board/obj/panda_h7_remote.bin.signed and b/panda/board/obj/panda_h7_remote.bin.signed differ diff --git a/panda/board/obj/panda_h7_remote_can_ignition_only.bin.signed b/panda/board/obj/panda_h7_remote_can_ignition_only.bin.signed index be5f481ddc..f687fe4f0b 100644 Binary files a/panda/board/obj/panda_h7_remote_can_ignition_only.bin.signed and b/panda/board/obj/panda_h7_remote_can_ignition_only.bin.signed differ diff --git a/panda/board/obj/panda_h7_tesla_wake.bin.signed b/panda/board/obj/panda_h7_tesla_wake.bin.signed index b66a0e0135..2a876db96e 100644 Binary files a/panda/board/obj/panda_h7_tesla_wake.bin.signed and b/panda/board/obj/panda_h7_tesla_wake.bin.signed differ diff --git a/panda/board/obj/panda_h7_tesla_wake_can_ignition_only.bin.signed b/panda/board/obj/panda_h7_tesla_wake_can_ignition_only.bin.signed index b12c21c4a5..c77169c212 100644 Binary files a/panda/board/obj/panda_h7_tesla_wake_can_ignition_only.bin.signed and b/panda/board/obj/panda_h7_tesla_wake_can_ignition_only.bin.signed differ diff --git a/panda/board/obj/panda_hkg_remote.bin.signed b/panda/board/obj/panda_hkg_remote.bin.signed index 8cde76595f..56fb3c29c2 100644 Binary files a/panda/board/obj/panda_hkg_remote.bin.signed and b/panda/board/obj/panda_hkg_remote.bin.signed differ diff --git a/panda/board/obj/panda_hkg_remote_can_ignition_only.bin.signed b/panda/board/obj/panda_hkg_remote_can_ignition_only.bin.signed index 5527fcc577..7ef4852604 100644 Binary files a/panda/board/obj/panda_hkg_remote_can_ignition_only.bin.signed and b/panda/board/obj/panda_hkg_remote_can_ignition_only.bin.signed differ diff --git a/panda/board/obj/panda_remote.bin.signed b/panda/board/obj/panda_remote.bin.signed index 557fa79868..5d0dd9397f 100644 Binary files a/panda/board/obj/panda_remote.bin.signed and b/panda/board/obj/panda_remote.bin.signed differ diff --git a/panda/board/obj/panda_remote_can_ignition_only.bin.signed b/panda/board/obj/panda_remote_can_ignition_only.bin.signed index e61127ee4b..cfa3c8c279 100644 Binary files a/panda/board/obj/panda_remote_can_ignition_only.bin.signed and b/panda/board/obj/panda_remote_can_ignition_only.bin.signed differ diff --git a/panda/board/obj/panda_tesla_wake.bin.signed b/panda/board/obj/panda_tesla_wake.bin.signed index 8ce8e6937c..4c4bbb2d53 100644 Binary files a/panda/board/obj/panda_tesla_wake.bin.signed and b/panda/board/obj/panda_tesla_wake.bin.signed differ diff --git a/panda/board/obj/panda_tesla_wake_can_ignition_only.bin.signed b/panda/board/obj/panda_tesla_wake_can_ignition_only.bin.signed index d3c6b4a8e4..698c548b91 100644 Binary files a/panda/board/obj/panda_tesla_wake_can_ignition_only.bin.signed and b/panda/board/obj/panda_tesla_wake_can_ignition_only.bin.signed differ diff --git a/panda/board/obj/version b/panda/board/obj/version index 783da545cf..f16a46b931 100644 --- a/panda/board/obj/version +++ b/panda/board/obj/version @@ -1 +1 @@ -DEV-82f431d8-Pf38f504f-DEBUG \ No newline at end of file +DEV-7950d25a-Pf38f504f-DEBUG \ No newline at end of file diff --git a/panda/tests/libpanda/libpanda.so b/panda/tests/libpanda/libpanda.so index 2682e2bba3..f5719c3e69 100755 Binary files a/panda/tests/libpanda/libpanda.so and b/panda/tests/libpanda/libpanda.so differ diff --git a/prebuilt.json b/prebuilt.json index 79816b89c9..25f2480f7e 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "00bca4db20a71c78165d81ae1a3b8d82fa5cdf7ffb76ae2083dce98e954bc57d", "schema_version": 1} +{"protected_inventory_sha256": "51265765f641a458e3d3b52679dc3b8e372fc6b72ebf5012f1e2d2f1e7e28f5c", "schema_version": 1}