中级会员
 
- 积分
- 280
- 金钱
- 280
- 注册时间
- 2016-7-3
- 在线时间
- 64 小时
|
1金钱
u8 CAN1_Receive_Msg(u8 *buf)
{
u32 i;
CanRxMsg RxMessage;
RxMessage.IDE=1
if( CAN_MessagePending(CAN1,CAN_FIFO0)==0)return 0; //ûóD½óêÕμ½êy¾Y,Ö±½óíË3ö
CAN_Receive(CAN1, CAN_FIFO0, &RxMessage);//¶áè¡êy¾Y
printf("%d\n",RxMessage.ExtId);
for(i=0;i<RxMessage.DLC;i++)
buf[i]=RxMessage.Data[i];
return RxMessage.DLC;
}
我用串口看接收的ID不对,但是数据是对的怎么回事,请教下
|
|