Using LWIP on Windows
First off, building MicroPython with MSVC and the ports/windows/micropython.vcxproj was exceptionally easy. Good job!
But when trying to add support for LwIP with:
-DMICROPY_PY_LWIP=1-DMICROPY_ENABLE_SCHEDULER=1- Add
extmod/modlwip.candlib/netutils/netutils.c.
And trying to figure out where to add that in the .vcxproj files was not so easy. So I hacked up my own GNU-makefile.
And then getting to the link stage, I got this error:
lwip32.lib(sys_arch.obj) : error LNK2005: _sys_arch_protect already defined in MicroPython.lib(modlwip.obj)
lwip32.lib(sys_arch.obj) : error LNK2005: _sys_arch_unprotect already defined in MicroPython.lib(modlwip.obj)
Is there another define that should be set to avoid this? Adding -DNO_SYS=1 did not help.
Or are we supposed to link with a dynamic LwIP import-library? Since that works.
extmod/modlwip: Remove unused include and functions.
<!-- Thanks for submitting a Pull Request! We appreciate you spending the
time to improve MicroPython. Please provide enough information so that
others can review your Pull Request.
Before submitting, please read:
https://github.com/micropython/micropython/blob/master/CODEOFCONDUCT.md
https://github.com/micropython/micropython/wiki/ContributorGuidelines
Please check any CI failures that appear after your Pull Request is opened.
-->
Summary
<!-- Explain the reason for making this change. What problem does the pull request
solve, or what improvement does it add? Add links if relevant. -->
The lwipopts.h is now port-specific.
The sys_arch_{,un}protect functions are not used according to line 34 of extmod/lwip-include/lwipopts_common.h.
Neither have been touched in nearly a decade.
Testing
<!-- Explain what testing you did, and on which boards/ports. If there are
boards or ports that you couldn't test, please mention this here as well.
If you leave this empty then your Pull Request may be closed. -->
Ensured that W5500-EVB-Pico builds and the resulting binary is unchanged.