最近写了个stm32 can的扩展帧收发程序 通过示波器看还是有数据的 但是不知道为什么就是接收不到
CAN_FilterInitStructure.CAN_FilterNumber = 0;
CAN_FilterInitStructure.CAN_FilterMode = CAN_FilterMode_IdMask;
CAN_FilterInitStructure.CAN_FilterScale = CAN_FilterScale_32bit;
CAN_FilterInitStructure.CAN_FilterIdHigh = (u16)(((PowerControl_ID<<3)>>16)&0xffff) ;
CAN_FilterInitStructure.CAN_FilterIdLow = (u16)(PowerControl_ID<<3)|CAN_ID_EXT|CAN_RTR_DATA&0xffff;
CAN_FilterInitStructure.CAN_FilterMaskIdHigh = 0xFFFF;
CAN_FilterInitStructure.CAN_FilterMaskIdLow = 0xFFFC;
CAN_FilterInitStructure.CAN_FilterFIFOAssignment = 0;
CAN_FilterInitStructure.CAN_FilterActivation = ENABLE;
TxMessage.ExtId = ExtId;
// TxMessage.StdId = StdId;
TxMessage.RTR=CAN_RTR_DATA; //数据帧
TxMessage.IDE=CAN_ID_EXT; //标准帧格式
// TxMessage.IDE=CAN_ID_STD; //标准帧格式
TxMessage.DLC=Count; //帧长度,单位:字节
问下还有什么需要设置的么 感觉没什么问题了啊
|