请教下,只接收指定ID帧,配置如下,现象是所有ID帧都接到了。。。
CAN_FilterInitStructure.CAN_FilterNumber = filter_num+14;
//璁剧疆涓烘帺鐮佹ā寮忚繃婊?
CAN_FilterInitStructure.CAN_FilterMode = CAN_FilterMode_IdList; // 设置滤波器模式为ID掩码模式
//浣跨敤涓?涓?32浣嶈繃婊ゅ櫒
CAN_FilterInitStructure.CAN_FilterScale = CAN_FilterScale_32bit; //32位滤波
CAN_FilterInitStructure.CAN_FilterIdHigh = node;
CAN_FilterInitStructure.CAN_FilterIdLow = 0;
CAN_FilterInitStructure.CAN_FilterMaskIdHigh = 0;//0x87E0;//0x87E0;
CAN_FilterInitStructure.CAN_FilterMaskIdLow = 0;//0x0007;
CAN_FilterInitStructure.CAN_FilterFIFOAssignment = CAN_FIFO0; //滤波器绑定FIFO 0
CAN_FilterInitStructure.CAN_FilterActivation = ENABLE; // 使能滤波器
CAN_FilterInit(&CAN_FilterInitStructure);
CAN_ITConfig(CAN2, CAN_IT_FMP0, ENABLE); |