Skip to content

Commit

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

This reverts commit 3034180
  • Loading branch information
sunnyhaibin committed Jun 6, 2023
1 parent fbdb6d0 commit 0e48095
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions board/drivers/can_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,25 +195,24 @@ 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 0e48095

Please sign in to comment.