|
前段时间做STM32+ENC28J60的网络产品,发现接入公司局域网后ping,回应也来越慢的问题.(分析是局域网中ARP包过多造成的,使用的是0.34版本)
这几天查找了一下原因发现函数struct pbuf *enc28j60_rx(rt_device_t dev)中spi_write_op(ENC28J60_BIT_FIELD_SET, ECON2, ECON2_PKTDEC)的位置改变以下就不出现变慢现象.
...............................
pk_counter = spi_read(EPKTCNT);
if (pk_counter)
{
...................
...................
// Move the RX read pointer to the start of the next received packet
// This frees the memory we just read out
spi_write(ERXRDPTL, (NextPacketPtr));
spi_write(ERXRDPTH, (NextPacketPtr)>>8);
spi_write_op(ENC28J60_BIT_FIELD_SET, ECON2, ECON2_PKTDEC);//新位置 // decrement the packet counter indicate we are done with this packet
}
else
{
.................
.................
}
//spi_write_op(ENC28J60_BIT_FIELD_SET, ECON2, ECON2_PKTDEC);//原来位置
|
阿莫论坛20周年了!感谢大家的支持与爱护!!
知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)
|