[ethernet] Address additional review feedback

- Remove dead ENC28J60 entry from _IDF6_ETHERNET_COMPONENTS
- Simplify get_duplex_mode() — both chips are full-duplex on RP2040
- Add #error guard for unsupported RP2040 SPI Ethernet type
This commit is contained in:
J. Nick Koston
2026-03-18 17:40:13 -10:00
parent 82348af414
commit 3c1431c322
3 changed files with 5 additions and 7 deletions
-1
View File
@@ -157,7 +157,6 @@ _IDF6_ETHERNET_COMPONENTS: dict[str, IDFRegistryComponent] = {
"KSZ8081RNA": IDFRegistryComponent("espressif/ksz80xx", "1.0.0"),
"W5500": IDFRegistryComponent("espressif/w5500", "1.0.1"),
"DM9051": IDFRegistryComponent("espressif/dm9051", "1.0.0"),
"ENC28J60": IDFRegistryComponent("espressif/enc28j60", "1.0.1"),
}
SPI_ETHERNET_TYPES = ["W5500", "DM9051", "ENC28J60"]
@@ -27,6 +27,8 @@ extern "C" eth_esp32_emac_config_t eth_esp32_emac_default_config(void);
#include <W5500lwIP.h>
#elif defined(USE_ETHERNET_ENC28J60)
#include <ENC28J60lwIP.h>
#else
#error "Unsupported RP2040 SPI Ethernet type"
#endif
#endif
@@ -224,6 +226,8 @@ class EthernetComponent final : public Component {
Wiznet5500lwIP *eth_{nullptr};
#elif defined(USE_ETHERNET_ENC28J60)
ENC28J60lwIP *eth_{nullptr};
#else
#error "Unsupported RP2040 SPI Ethernet type"
#endif
uint32_t last_link_check_{0};
uint8_t clk_pin_;
@@ -226,13 +226,8 @@ const char *EthernetComponent::get_eth_mac_address_pretty_into_buffer(
}
eth_duplex_t EthernetComponent::get_duplex_mode() {
#ifdef USE_ETHERNET_ENC28J60
// ENC28J60 is configured for full-duplex by the arduino-pico driver
// Both W5500 and ENC28J60 are full-duplex on RP2040
return ETH_DUPLEX_FULL;
#else
// W5500 is always full duplex
return ETH_DUPLEX_FULL;
#endif
}
eth_speed_t EthernetComponent::get_link_speed() {