Skip to content

Commit e0f9262

Browse files
committed
add PSA exception with counter
1 parent 1ffad74 commit e0f9262

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

board/drivers/can_common.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,21 @@ void ignition_can_hook(CANPacket_t *msg) {
201201
ignition_can_cnt = 0U;
202202
}
203203

204+
} else if (msg->bus == 2) {
205+
int len = GET_LEN(msg);
206+
207+
// PSA exception
208+
if ((msg->addr == 0x432) && (len == 8)) {
209+
int counter = msg->data[1] & 0xFU;
210+
211+
static int prev_counter_psa = -1;
212+
if ((counter == ((prev_counter_psa + 1) % 16)) && (prev_counter_psa != -1)) {
213+
// Dat_BSI1->P369_Com_stElecNetRaw
214+
ignition_can = (msg->data[7] >> 4) == 0x5U;
215+
ignition_can_cnt = 0U;
216+
}
217+
prev_counter_psa = counter;
218+
}
204219
}
205220
}
206221

0 commit comments

Comments
 (0)