mirror of
https://github.com/esphome/esphome.git
synced 2026-09-15 09:08:41 +00:00
[ethernet] Guard per-chip PHY/MAC includes with IDF >= 6.0
On IDF 5.x these headers don't exist as standalone files — they are included internally via esp_eth.h. On IDF 6.0 they moved to registry components and need explicit includes. LAN867x is unchanged (external component since IDF 5.3).
This commit is contained in:
@@ -10,6 +10,10 @@
|
||||
#include <cinttypes>
|
||||
#include "esp_event.h"
|
||||
|
||||
// IDF 6.0 moved per-chip PHY/MAC drivers to the Espressif Component Registry;
|
||||
// they are no longer included via esp_eth.h and need explicit includes.
|
||||
// On IDF 5.x these headers don't exist as standalone files.
|
||||
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0)
|
||||
#ifdef USE_ETHERNET_LAN8720
|
||||
#include "esp_eth_phy_lan87xx.h"
|
||||
#endif
|
||||
@@ -25,9 +29,6 @@
|
||||
#ifdef USE_ETHERNET_KSZ8081
|
||||
#include "esp_eth_phy_ksz80xx.h"
|
||||
#endif
|
||||
#ifdef USE_ETHERNET_LAN8670
|
||||
#include "esp_eth_phy_lan867x.h"
|
||||
#endif
|
||||
#ifdef USE_ETHERNET_W5500
|
||||
#include "esp_eth_mac_w5500.h"
|
||||
#include "esp_eth_phy_w5500.h"
|
||||
@@ -36,6 +37,12 @@
|
||||
#include "esp_eth_mac_dm9051.h"
|
||||
#include "esp_eth_phy_dm9051.h"
|
||||
#endif
|
||||
#endif // ESP_IDF_VERSION >= 6.0.0
|
||||
|
||||
// LAN867x header exists on all IDF versions (external component since IDF 5.3)
|
||||
#ifdef USE_ETHERNET_LAN8670
|
||||
#include "esp_eth_phy_lan867x.h"
|
||||
#endif
|
||||
|
||||
#ifdef USE_ETHERNET_SPI
|
||||
#include <driver/gpio.h>
|
||||
|
||||
Reference in New Issue
Block a user