Merge pull request #2998 from tyustli/can

[bsp] [stm32] fix drv_can.c and can.c bug
This commit is contained in:
Bernard Xiong
2019-08-24 13:50:15 +08:00
committed by GitHub
2 changed files with 12 additions and 2 deletions
@@ -515,7 +515,11 @@ static int _can_recvmsg(struct rt_can_device *can, void *buf, rt_uint32_t fifo)
/* get len */
pmsg->len = rxheader.DLC;
/* get hdr */
#ifdef BSP_USING_CAN2
pmsg->hdr = rxheader.FilterMatchIndex;
#else
pmsg->hdr = (rxheader.FilterMatchIndex + 1) >> 1;
#endif
return RT_EOK;
}