Wiznet/RP2040-HAT-LWIP-C

do/while loop in wizchip_initialize() in w5x00_spi.c is blocking if network cable is unplugged

inthestillofthenight opened this issue · 0 comments

This is really a question, as a result of a question on the WIZnet forum (topic 10579).
Why does the code in wizchip_initialize() block until LINK UP is established? So when called if the ethernet cable is unplugged or the switch is down the call would not return. See code at line 211 here: https://github.com/Wiznet/RP2040-HAT-LWIP-C/blob/main/port/ioLibrary_Driver/src/w5x00_spi.c

Would it do any harm to just return the LINK status rather than looping to wait for LINK_UP? or can it just return no matter what the LINK status is?
Unplugging and re-plugging the cable back in once the network is up results in full recovery.

This call is made in nearly all of the example programs.