提交 0779b5e9 编写于 作者: F fengzi2003 提交者: GitHub

Update stm32_eth.c

 Fix some exception handling,such as when rt_sem_take failed in tx,transmission cannot be resumed。
上级 794835dd
......@@ -3206,7 +3206,12 @@ rt_err_t rt_stm32_eth_tx( rt_device_t dev, struct pbuf* p)
{
rt_err_t result;
result = rt_sem_take(&tx_buf_free, 2);
if (result != RT_EOK) return -RT_ERROR;
if (result != RT_EOK)
{
ETH_FlushTransmitFIFO(); // clear fifo
ETH_ResumeDMATransmission(); // resume dma
return -RT_ERROR;
}
}
offset = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册