Skip to content

Commit

Permalink
modify before we forward
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed Jun 6, 2018
1 parent bf70f51 commit 63ca46b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions board/drivers/can.h
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ void can_rx(uint8_t can_number) {
to_push.RDLR = CAN->sFIFOMailBox[0].RDLR;
to_push.RDHR = CAN->sFIFOMailBox[0].RDHR;

// modify RDTR for our API
to_push.RDTR = (to_push.RDTR & 0xFFFF000F) | (bus_number << 4);

// forwarding (panda only)
#ifdef PANDA
int bus_fwd_num = can_forwarding[bus_number] != -1 ? can_forwarding[bus_number] : safety_fwd_hook(bus_number, &to_push);
Expand All @@ -428,8 +431,6 @@ void can_rx(uint8_t can_number) {
}
#endif

// modify RDTR for our API
to_push.RDTR = (to_push.RDTR & 0xFFFF000F) | (bus_number << 4);
safety_rx_hook(&to_push);

#ifdef PANDA
Expand Down

0 comments on commit 63ca46b

Please sign in to comment.