ErrStatus enet_software_reset(void)
{
uint32_t timeout = 0U;
ErrStatus enet_state = ERROR;
uint32_t dma_flag;
/* reset all core internal registers located in CLK_TX and CLK_RX */
ENET_DMA_BCTL |= ENET_DMA_BCTL_SWR;
/* wait for reset operation complete */
do{
dma_flag = (ENET_DMA_BCTL & ENET_DMA_BCTL_SWR);
timeout++;
}while((RESET != dma_flag) && (ENET_DELAY_TO != timeout));
/* reset operation complete */
if(RESET == (ENET_DMA_BCTL & ENET_DMA_BCTL_SWR)){
enet_state = SUCCESS;
}
return enet_state;
}
gd32f4xx_enet.c这个老是失败,led闪灯例程没有毛病
|