From b23c7aa38be3856fc54f12838bf5f054c22b6822 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 29 Jul 2025 14:16:20 -0700 Subject: [PATCH] opendbc updates (#2245) * opendbc updates * get latest opendbc in docker * . --- Dockerfile | 4 ++++ Jenkinsfile | 2 +- board/drivers/can_common.h | 20 ++++++++++---------- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1d1cff70..a8a80e97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,5 +11,9 @@ COPY pyproject.toml __init__.py setup.sh $WORKDIR RUN mkdir -p $WORKDIR/python/ && touch $WORKDIR/__init__.py RUN apt-get update && apt-get install -y --no-install-recommends sudo && DEBIAN_FRONTEND=noninteractive $WORKDIR/setup.sh +# second pass for the opendbc moving tag +ARG CACHEBUST=1 +RUN DEBIAN_FRONTEND=noninteractive $WORKDIR/setup.sh + RUN git config --global --add safe.directory $WORKDIR/panda COPY . $WORKDIR diff --git a/Jenkinsfile b/Jenkinsfile index 2f5341c0..25e386a0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -85,7 +85,7 @@ pipeline { steps { timeout(time: 20, unit: 'MINUTES') { script { - dockerImage = docker.build("${env.DOCKER_IMAGE_TAG}") + dockerImage = docker.build("${env.DOCKER_IMAGE_TAG}", "--build-arg CACHEBUST=${env.BUILD_NUMBER} .") } } } diff --git a/board/drivers/can_common.h b/board/drivers/can_common.h index a5712335..23e0c1a4 100644 --- a/board/drivers/can_common.h +++ b/board/drivers/can_common.h @@ -160,28 +160,28 @@ void can_set_forwarding(uint8_t from, uint8_t to) { } #endif -void ignition_can_hook(CANPacket_t *to_push) { - int bus = GET_BUS(to_push); +void ignition_can_hook(CANPacket_t *msg) { + int bus = GET_BUS(msg); if (bus == 0) { - int addr = GET_ADDR(to_push); - int len = GET_LEN(to_push); + int addr = GET_ADDR(msg); + int len = GET_LEN(msg); // GM exception if ((addr == 0x1F1) && (len == 8)) { // SystemPowerMode (2=Run, 3=Crank Request) - ignition_can = (GET_BYTE(to_push, 0) & 0x2U) != 0U; + ignition_can = (msg->data[0] & 0x2U) != 0U; ignition_can_cnt = 0U; } // Rivian R1S/T GEN1 exception if ((addr == 0x152) && (len == 8)) { // 0x152 overlaps with Subaru pre-global which has this bit as the high beam - int counter = GET_BYTE(to_push, 1) & 0xFU; // max is only 14 + int counter = msg->data[1] & 0xFU; // max is only 14 static int prev_counter_rivian = -1; if ((counter == ((prev_counter_rivian + 1) % 15)) && (prev_counter_rivian != -1)) { // VDM_OutputSignals->VDM_EpasPowerMode - ignition_can = ((GET_BYTE(to_push, 7) >> 4U) & 0x3U) == 1U; // VDM_EpasPowerMode_Drive_On=1 + ignition_can = ((msg->data[7] >> 4U) & 0x3U) == 1U; // VDM_EpasPowerMode_Drive_On=1 ignition_can_cnt = 0U; } prev_counter_rivian = counter; @@ -190,12 +190,12 @@ void ignition_can_hook(CANPacket_t *to_push) { // Tesla Model 3/Y exception if ((addr == 0x221) && (len == 8)) { // 0x221 overlaps with Rivian which has random data on byte 0 - int counter = GET_BYTE(to_push, 6) >> 4; + int counter = msg->data[6] >> 4; static int prev_counter_tesla = -1; if ((counter == ((prev_counter_tesla + 1) % 16)) && (prev_counter_tesla != -1)) { // VCFRONT_LVPowerState->VCFRONT_vehiclePowerState - int power_state = (GET_BYTE(to_push, 0) >> 5U) & 0x3U; + int power_state = (msg->data[0] >> 5U) & 0x3U; ignition_can = power_state == 0x3; // VEHICLE_POWER_STATE_DRIVE=3 ignition_can_cnt = 0U; } @@ -204,7 +204,7 @@ void ignition_can_hook(CANPacket_t *to_push) { // Mazda exception if ((addr == 0x9E) && (len == 8)) { - ignition_can = (GET_BYTE(to_push, 0) >> 5) == 0x6U; + ignition_can = (msg->data[0] >> 5) == 0x6U; ignition_can_cnt = 0U; }