This is WIZnet Ethernet Interface using Hardware TCP/IP chip, W5500, W5200 and W5100. One of them can be selected by enabling it in wiznet.h.

Dependencies:   mbed

Fork of WIZnet_Library by WIZnet

Files at this revision

API Documentation at this revision

Comitter:
Bongjun
Date:
Thu Jul 10 04:55:47 2014 +0000
Parent:
2:96f102b31e72
Commit message:
fix Sn_IR read error

Changed in this revision

WIZnetInterface/WIZnet/W5500.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 96f102b31e72 -r 9997e2b7d459 WIZnetInterface/WIZnet/W5500.cpp
--- a/WIZnetInterface/WIZnet/W5500.cpp	Thu Jul 10 04:43:49 2014 +0000
+++ b/WIZnetInterface/WIZnet/W5500.cpp	Thu Jul 10 04:55:47 2014 +0000
@@ -222,8 +222,10 @@
     spi_write(ptr, cntl_byte, (uint8_t*)str, len);
     sreg<uint16_t>(socket, Sn_TX_WR, ptr + len);
     scmd(socket, SEND);
-    
-    while ((sreg<uint8_t>(socket, Sn_IR) & INT_SEND_OK) != INT_SEND_OK) {
+
+    uint8_t tmp_Sn_IR;
+//    while ((sreg<uint8_t>(socket, Sn_IR) & INT_SEND_OK) != INT_SEND_OK) {
+    while (( (tmp_Sn_IR = sreg<uint8_t>(socket, Sn_IR)) & INT_SEND_OK) != INT_SEND_OK) {
 /*
         if (sreg<uint8_t>(socket, Sn_SR) == CLOSED) {
             close(socket);
@@ -238,14 +240,14 @@
                 //break;
             case SOCK_UDP :
                 // ARP timeout is possible.
-                if ((sreg<uint8_t>(socket, Sn_IR) & INT_TIMEOUT) != INT_TIMEOUT) {
+                if ((tmp_Sn_IR & INT_TIMEOUT) == INT_TIMEOUT) {
                     sreg<uint8_t>(socket, Sn_IR, INT_TIMEOUT);
                     return 0;
                 }
                 break;
             default :
                 break;
-        }        
+        }
     }
     sreg<uint8_t>(socket, Sn_IR, INT_SEND_OK);