From fcb1a5a8e233a8b520c42c58cf8bfaa82753ac5a Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 20 Oct 2022 19:52:06 -0700 Subject: [PATCH] Hyundai CAN-FD: common brake pressed signal (#1113) * Hyundai CAN-FD: common brake pressed signal * change bit Co-authored-by: Shane Smiskol --- Dockerfile.panda | 2 +- board/safety/safety_hyundai_canfd.h | 8 ++++---- tests/safety/test_hyundai_canfd.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile.panda b/Dockerfile.panda index 3719a7cb30..4c3719417e 100644 --- a/Dockerfile.panda +++ b/Dockerfile.panda @@ -51,7 +51,7 @@ ENV PATH="/root/.pyenv/bin:/root/.pyenv/shims:${PATH}" ENV PANDA_PATH=/tmp/openpilot/panda ENV OPENPILOT_REF="96e8d5c9fe1a8084dfa5d97c78d4ea2037272420" -ENV OPENDBC_REF="04cc54d5e662aaf708f72cabb65507c7dbb5136d" +ENV OPENDBC_REF="7bd94e3ff4a2890eb69118f0dfadb64f9d32d618" COPY requirements.txt /tmp/ RUN pyenv install 3.8.10 && \ diff --git a/board/safety/safety_hyundai_canfd.h b/board/safety/safety_hyundai_canfd.h index 60fd34dceb..59b33fca94 100644 --- a/board/safety/safety_hyundai_canfd.h +++ b/board/safety/safety_hyundai_canfd.h @@ -51,8 +51,8 @@ AddrCheckStruct hyundai_canfd_addr_checks[] = { {.msg = {{0x35, 1, 32, .check_checksum = true, .max_counter = 0xffU, .expected_timestep = 10000U}, {0x35, 0, 32, .check_checksum = true, .max_counter = 0xffU, .expected_timestep = 10000U}, {0x105, 0, 32, .check_checksum = true, .max_counter = 0xffU, .expected_timestep = 10000U}}}, - {.msg = {{0x65, 1, 32, .check_checksum = true, .max_counter = 0xffU, .expected_timestep = 10000U}, - {0x65, 0, 32, .check_checksum = true, .max_counter = 0xffU, .expected_timestep = 10000U}, { 0 }}}, + {.msg = {{0x175, 1, 24, .check_checksum = true, .max_counter = 0xffU, .expected_timestep = 20000U}, + {0x175, 0, 24, .check_checksum = true, .max_counter = 0xffU, .expected_timestep = 20000U}, { 0 }}}, {.msg = {{0xa0, 1, 24, .check_checksum = true, .max_counter = 0xffU, .expected_timestep = 10000U}, {0xa0, 0, 24, .check_checksum = true, .max_counter = 0xffU, .expected_timestep = 10000U}, { 0 }}}, {.msg = {{0xea, 1, 24, .check_checksum = true, .max_counter = 0xffU, .expected_timestep = 10000U}, @@ -180,8 +180,8 @@ static int hyundai_canfd_rx_hook(CANPacket_t *to_push) { } // brake press - if (addr == 0x65) { - brake_pressed = GET_BIT(to_push, 57U) != 0U; + if (addr == 0x175) { + brake_pressed = GET_BIT(to_push, 81U) != 0U; } // vehicle moving diff --git a/tests/safety/test_hyundai_canfd.py b/tests/safety/test_hyundai_canfd.py index 649e829d17..4219277265 100755 --- a/tests/safety/test_hyundai_canfd.py +++ b/tests/safety/test_hyundai_canfd.py @@ -56,8 +56,8 @@ def _speed_msg(self, speed): return self.packer.make_can_msg_panda("WHEEL_SPEEDS", self.PT_BUS, values) def _user_brake_msg(self, brake): - values = {"BRAKE_PRESSED": brake} - return self.packer.make_can_msg_panda("BRAKE", self.PT_BUS, values) + values = {"DriverBraking": brake} + return self.packer.make_can_msg_panda("TCS", self.PT_BUS, values) def _user_gas_msg(self, gas): values = {"ACCELERATOR_PEDAL": gas}