A PicoTCP driver for the lpc1768 mbed board
Dependents: lpc1768-picotcp-demo TCPSocket_HelloWorld_PicoTCP Pico_TCP_UDP_Test TCPSocket_HelloWorld_PicoTCP ... more
Diff: pico_dev_mbed_emac.cpp
- Revision:
- 10:7b931f77f39a
- Parent:
- 9:1ef61e7465a5
- Child:
- 11:a85f164b4d28
diff -r 1ef61e7465a5 -r 7b931f77f39a pico_dev_mbed_emac.cpp --- a/pico_dev_mbed_emac.cpp Thu Jul 25 11:46:04 2013 +0000 +++ b/pico_dev_mbed_emac.cpp Mon Nov 25 11:23:49 2013 +0000 @@ -637,9 +637,10 @@ static uint8_t _emac_update_phy_status(uint32_t linksts) { uint8_t changed = 0; + static uint32_t mask = DP8_VALID_LINK | DP8_FULLDUPLEX | DP8_SPEED10MBPS; static uint32_t oldlinksts = 0; - - if (oldlinksts != linksts) + + if ((oldlinksts & mask) != (linksts & mask)) changed = 1; if (changed) @@ -694,7 +695,7 @@ uint32_t data = LPC_EMAC->MRDD; LPC_EMAC->MCMD = 0; - return data; + return data & 0xFFFF; } // Phy status update state machine