Fix bug for drv_enet.c

源文件主要存在以下问题:
1> rt_hw_gd32_eth_init函数中对MAC初始化完成后并没有修改PHY的连接状态,这会导致测试TCP例程时无法建立TCP链接,应在初始化完成后将PHY的连接状态修改成linkup;

已在GD32450Z-EVAL开发板上测试,修改后没有再出现以上问题。
This commit is contained in:
chao_king 2019-12-26 19:03:46 +08:00 committed by GitHub
parent 8d0ca47526
commit ae90273b68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -653,6 +653,9 @@ int rt_hw_gd32_eth_init(void)
rt_sem_init(&gd32_emac_device0.tx_buf_free, "tx_buf0", EMAC_TXBUFNB, RT_IPC_FLAG_FIFO);
eth_device_init(&(gd32_emac_device0.parent), "e0");
/* change device link status */
eth_device_linkchange(&(gd32_emac_device0.parent), RT_TRUE);
return 0;
}
INIT_DEVICE_EXPORT(rt_hw_gd32_eth_init);