为简洁没贴出全部,IMR_PTX、IMR_TXE是错误标志位。
// 轮询接收
void RTL8019_Poll(void)
{
........................
// Check whether currently transmitting a packet.
if(NIC & TXP)
{
// If neither a successful transmission nor a tx abort error
// has occured, then flag current tx packet for resend.
if(!((ISR & IMR_PTX) || (ISR & IMR_TXE))) // 无错
{
retransmit = 1; // 重发
}
}
...............
if(retransmit) // 无错置位为何重发
{
// Retransmit packet in RTL8019AS local tx buffer.
NIC = ABORT | TXP | START_CR;
}
...............
} |