Skip to content

Commit

Permalink
Revert "Revert "Reset CAN ign when the specific message is not seen a…
Browse files Browse the repository at this point in the history
…nymore (commaai#1200)""

This reverts commit 0e48095.
  • Loading branch information
sunnyhaibin committed Jun 6, 2023
1 parent 0e48095 commit 02e1b49
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions board/drivers/can_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,24 +195,25 @@ void ignition_can_hook(CANPacket_t *to_push) {
int addr = GET_ADDR(to_push);
int len = GET_LEN(to_push);

ignition_can_cnt = 0U; // reset counter

if (bus == 0) {
// GM exception
if ((addr == 0x160) && (len == 5)) {
// this message isn't all zeros when ignition is on
ignition_can = GET_BYTES(to_push, 0, 4) != 0U;
ignition_can_cnt = 0U;
}

// Tesla exception
if ((addr == 0x348) && (len == 8)) {
// GTW_status
ignition_can = (GET_BYTE(to_push, 0) & 0x1U) != 0U;
ignition_can_cnt = 0U;
}

// Mazda exception
if ((addr == 0x9E) && (len == 8)) {
ignition_can = (GET_BYTE(to_push, 0) >> 5) == 0x6U;
ignition_can_cnt = 0U;
}

}
Expand Down

0 comments on commit 02e1b49

Please sign in to comment.