Skip to content

Commit 63ca46b

Browse files
committed
modify before we forward
1 parent bf70f51 commit 63ca46b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

board/drivers/can.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,9 @@ void can_rx(uint8_t can_number) {
415415
to_push.RDLR = CAN->sFIFOMailBox[0].RDLR;
416416
to_push.RDHR = CAN->sFIFOMailBox[0].RDHR;
417417

418+
// modify RDTR for our API
419+
to_push.RDTR = (to_push.RDTR & 0xFFFF000F) | (bus_number << 4);
420+
418421
// forwarding (panda only)
419422
#ifdef PANDA
420423
int bus_fwd_num = can_forwarding[bus_number] != -1 ? can_forwarding[bus_number] : safety_fwd_hook(bus_number, &to_push);
@@ -428,8 +431,6 @@ void can_rx(uint8_t can_number) {
428431
}
429432
#endif
430433

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

435436
#ifdef PANDA

0 commit comments

Comments
 (0)