The approach with selecting the network controller inside the library's config.h is hardly usable in real projects - it is impossible to tweak it for every build.
There are several approaches which can address this issue:
- Wrap
#define NETWORK_CONTROLLER ETHERNET_CONTROLLER_W5X00 with #ifnded NETWORK_CONTROLLER and #endif so if the build system support global defines, the project will choose the proper network controller.
- Do a meaningful guess of the network controller (e.g., when
ESP8266 or ESP32 is defined, the chances are high that WiFi is used), so for rigid build systems (like the one in Arduino IDE) the library can be used as is.
Environment info
- IDE w/version: Arduino IDE 1.8.16
- Platform/Board: esp8266
- Network controller (shield or module): WiFi
The approach with selecting the network controller inside the library's
config.his hardly usable in real projects - it is impossible to tweak it for every build.There are several approaches which can address this issue:
#define NETWORK_CONTROLLER ETHERNET_CONTROLLER_W5X00with#ifnded NETWORK_CONTROLLERand#endifso if the build system support global defines, the project will choose the proper network controller.ESP8266orESP32is defined, the chances are high that WiFi is used), so for rigid build systems (like the one in Arduino IDE) the library can be used as is.Environment info