blocky block

This commit is contained in:
firestar5683
2026-05-27 16:37:32 -05:00
parent b535c0845e
commit 35a7e43045
2 changed files with 16 additions and 0 deletions
@@ -24,6 +24,9 @@
#define HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(e_can, longitudinal) \
{0x1A0, e_can, 32, .check_relay = (longitudinal)}, /* SCC_CONTROL */ \
#define HYUNDAI_CANFD_MRR35_RADAR_TRACK_START 0x3A5
#define HYUNDAI_CANFD_MRR35_RADAR_TRACK_END 0x3C4
#define HYUNDAI_CANFD_BLINDSPOT_DASH_TX_MSGS(e_can) \
{0x1BA, e_can, 24, .check_relay = false}, /* BLINDSPOTS_REAR_CORNERS */ \
{0x1E5, e_can, 16, .check_relay = false}, /* BLINDSPOTS_FRONT_CORNER_1 */ \
@@ -81,6 +84,15 @@ static void hyundai_canfd_rx_all_hook(const CANPacket_t *msg) {
SAFETY_UNUSED(msg);
}
static bool hyundai_canfd_fwd_hook(int bus_num, int addr) {
const bool mrr35_radar_track = (addr >= HYUNDAI_CANFD_MRR35_RADAR_TRACK_START) && (addr <= HYUNDAI_CANFD_MRR35_RADAR_TRACK_END);
// On LKA-steering long-control cars using live MRR35 radar tracks, openpilot parses
// the tracks directly from bus 0. Forwarding them to bus 2 creates a returned TX copy
// of every object frame on the logged CAN stream without adding planner data.
return hyundai_longitudinal && hyundai_canfd_lka_steering && (bus_num == 0) && mrr35_radar_track;
}
static void hyundai_canfd_rx_hook(const CANPacket_t *msg) {
const unsigned pt_bus = hyundai_canfd_lka_steering ? 1U : 0U;
@@ -485,4 +497,5 @@ const safety_hooks hyundai_canfd_hooks = {
.get_counter = hyundai_canfd_get_counter,
.get_checksum = hyundai_canfd_get_checksum,
.compute_checksum = hyundai_common_canfd_compute_checksum,
.fwd = hyundai_canfd_fwd_hook,
};
@@ -26,6 +26,8 @@ ALL_GAS_EV_HYBRID_COMBOS = [
{"GAS_MSG": ("ACCELERATOR_ALT", "ACCELERATOR_PEDAL"), "SCC_BUS": 2, "SAFETY_PARAM": HyundaiSafetyFlags.HYBRID_GAS | HyundaiSafetyFlags.CAMERA_SCC},
]
MRR35_RADAR_TRACK_ADDRS = list(range(0x3A5, 0x3C5))
def _set_value(msg: bytearray, sig, ival: int) -> None:
i = sig.lsb // 8
@@ -516,6 +518,7 @@ class TestHyundaiCanfdLKASteeringLongEV(HyundaiLongitudinalBase, TestHyundaiCanf
[0x1a0, 1], [0x1ea, 1], [0x200, 1], [0x345, 1], [0x1da, 1]]
RELAY_MALFUNCTION_ADDRS = {0: (0x50, 0x2a4), 1: (0x1a0,)} # LKAS, CAM_0x2A4, SCC_CONTROL
FWD_BLACKLISTED_ADDRS = {0: MRR35_RADAR_TRACK_ADDRS, 2: [0x50, 0x2a4]}
DISABLED_ECU_UDS_MSG = (0x730, 1)
DISABLED_ECU_ACTUATION_MSG = (0x1a0, 1)