From e0f9262149e2a6f537220b93d00f5502ad0e5b94 Mon Sep 17 00:00:00 2001 From: elkoled Date: Mon, 22 Dec 2025 18:08:06 +0100 Subject: [PATCH] add PSA exception with counter --- board/drivers/can_common.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/board/drivers/can_common.h b/board/drivers/can_common.h index 35c6702e807..0f4fa48daf0 100644 --- a/board/drivers/can_common.h +++ b/board/drivers/can_common.h @@ -201,6 +201,21 @@ void ignition_can_hook(CANPacket_t *msg) { ignition_can_cnt = 0U; } + } else if (msg->bus == 2) { + int len = GET_LEN(msg); + + // PSA exception + if ((msg->addr == 0x432) && (len == 8)) { + int counter = msg->data[1] & 0xFU; + + static int prev_counter_psa = -1; + if ((counter == ((prev_counter_psa + 1) % 16)) && (prev_counter_psa != -1)) { + // Dat_BSI1->P369_Com_stElecNetRaw + ignition_can = (msg->data[7] >> 4) == 0x5U; + ignition_can_cnt = 0U; + } + prev_counter_psa = counter; + } } }