void WCHNET_ETHIsr( void ) { uint8_t eth_irq_flag, estat_regval; eth_irq_flag = R8_ETH_EIR; if(eth_irq_flag&RB_ETH_EIR_RXIF) //Receive complete { R8_ETH_EIR = RB_ETH_EIR_RXIF; /* Check if the descriptor is owned by the ETHERNET DMA */ if( DMARxDescToGet->Status & ETH_DMARxDesc_OWN ) { estat_regval = R8_ETH_ESTAT; if(estat_regval & \ (RB_ETH_ESTAT_BUFER | RB_ETH_ESTAT_RXCRCER | RB_ETH_ESTAT_RXNIBBLE | RB_ETH_ESTAT_RXMORE)) { return; } if( ((ETH_DMADESCTypeDef*)(DMARxDescToGet->Buffer2NextDescAddr))->Status& ETH_DMARxDesc_OWN ) { DMARxDescToGet->Status &= ~ETH_DMARxDesc_OWN; DMARxDescToGet->Status &= ~ETH_DMARxDesc_ES; DMARxDescToGet->Status |= (ETH_DMARxDesc_FS|ETH_DMARxDesc_LS); DMARxDescToGet->Status &= ~ETH_DMARxDesc_FL; DMARxDescToGet->Status |= ((R16_ETH_ERXLN+4)<Buffer2NextDescAddr); R16_ETH_ERXST = DMARxDescToGet->Buffer1Addr; } }
在这个中断里面接收PHY的数据,每次接收几次之后就无法触发
if( DMARxDescToGet->Status & ETH_DMARxDesc_OWN )
接收检查通过不了,但是接收是完成的,这个是什么原因造成的?
热门产品 :
CH592: RISC-V内核BLE5.4无线MCU