旁路模式可以收到,ACCF_ON模式下不可以收到,请问是什么原因,要怎么设置,设置的程序 下:
/* Acceptance filter mode in AFMR register */
#define ACCF_OFF 0x01
#define ACCF_BYPASS 0x02
#define ACCF_ON 0x00
#define ACCF_FULLCAN 0x04
void CAN_SetACCF( uint32_t ACCFMode )
{
switch ( ACCFMode )
{
case ACCF_OFF:
LPC_CANAF->AFMR = ACCFMode;
LPC_CAN1->MOD = LPC_CAN2->MOD = 1; // Reset CAN
LPC_CAN1->IER = LPC_CAN2->IER = 0; // Disable Receive Interrupt
LPC_CAN1->GSR = LPC_CAN2->GSR = 0; // Reset error counter when CANxMOD is in reset
break;
case ACCF_BYPASS:
LPC_CANAF->AFMR = ACCFMode;
break;
case ACCF_ON:
case ACCF_FULLCAN:
LPC_CANAF->AFMR = ACCF_OFF;
CAN_SetACCF_Lookup();
LPC_CANAF->AFMR = ACCFMode;
break;
default:
break;
}
return;
}
|
|