This is the Interface library for WIZnet W5500 chip which forked of EthernetInterfaceW5500, WIZnetInterface and WIZ550ioInterface. This library has simple name as "W5500Interface". and can be used for Wiz550io users also.
Dependents: EvrythngApi Websocket_Ethernet_HelloWorld_W5500 Websocket_Ethernet_W5500 CurrentWeatherData_W5500 ... more
Information
It has EthernetInterface class like official EthernetInterface , but uses Wiznet chip driver codes.
So this library can use only the WIZnet W5500 or WIZ550io users.
This library has referred to many project such as WIZ550ioInterface, WiflyInterface and WIZnet Library.
Thanks all.
Revision 3:a5d99521e9cc, committed 2014-08-20
- Comitter:
- Bongjun
- Date:
- Wed Aug 20 05:37:05 2014 +0000
- Parent:
- 2:e02950866c42
- Child:
- 4:af0ed4fbca02
- Commit message:
- fix some codes of reading Sn_RX_RSR, Sn_TX_FSR in W5500.cpp
Changed in this revision
WIZnet/W5500.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/WIZnet/W5500.cpp Wed Aug 20 05:09:16 2014 +0000 +++ b/WIZnet/W5500.cpp Wed Aug 20 05:37:05 2014 +0000 @@ -169,7 +169,6 @@ int WIZnet_Chip::wait_readable(int socket, int wait_time_ms, int req_size) { - int size, size2; if (socket < 0) { return -1; } @@ -177,7 +176,14 @@ t.reset(); t.start(); while(1) { - int size = sreg<uint16_t>(socket, Sn_RX_RSR); + //int size = sreg<uint16_t>(socket, Sn_RX_RSR); + int size, size2; + // during the reading Sn_RX_RSR, it has the possible change of this register. + // so read twice and get same value then use size information. + do { + size = sreg<uint16_t>(socket, Sn_RX_RSR); + size2 = sreg<uint16_t>(socket, Sn_RX_RSR); + } while (size != size2); if (size > req_size) { return size; @@ -191,7 +197,6 @@ int WIZnet_Chip::wait_writeable(int socket, int wait_time_ms, int req_size) { - int size, size2; if (socket < 0) { return -1; } @@ -200,6 +205,7 @@ t.start(); while(1) { //int size = sreg<uint16_t>(socket, Sn_TX_FSR); + int size, size2; // during the reading Sn_TX_FSR, it has the possible change of this register. // so read twice and get same value then use size information. do {