From b319fb53e44cfce382edf3ea9def13b1ba642260 Mon Sep 17 00:00:00 2001 From: "Aubr.Cool" Date: Fri, 5 Jun 2015 08:33:56 +0800 Subject: [PATCH] correct bxcan rcv msg rtr flag set --- bsp/stm32f10x/drivers/bxcan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp/stm32f10x/drivers/bxcan.c b/bsp/stm32f10x/drivers/bxcan.c index 8c9b39ecf..db89eda5c 100644 --- a/bsp/stm32f10x/drivers/bxcan.c +++ b/bsp/stm32f10x/drivers/bxcan.c @@ -1063,7 +1063,7 @@ static int recvmsg(struct rt_can_device *can, void* buf, rt_uint32_t boxno) pmsg->id = (uint32_t)0x1FFFFFFF & (pbxcan->sFIFOMailBox[boxno].RIR >> 3); } - pmsg->rtr = (uint8_t)0x02 & pbxcan->sFIFOMailBox[boxno].RIR; + pmsg->rtr = ((uint8_t)0x02 & pbxcan->sFIFOMailBox[boxno].RIR) >> 1; pmsg->len = (uint8_t)0x0F & pbxcan->sFIFOMailBox[boxno].RDTR; pmsg->data[0] = (uint8_t)0xFF & pbxcan->sFIFOMailBox[boxno].RDLR; pmsg->data[1] = (uint8_t)0xFF & (pbxcan->sFIFOMailBox[boxno].RDLR >> 8);