modify before we forward

This commit is contained in:
George Hotz 2018-06-06 13:46:12 -07:00
parent bf70f51596
commit 63ca46bc24
1 changed files with 3 additions and 2 deletions

View File

@ -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);
@ -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