Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

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

Open
inthestillofthenight opened this issue Jan 10, 2023 · 0 comments

Comments

@inthestillofthenight
Copy link

inthestillofthenight commented Jan 10, 2023

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant