mirror of
https://github.com/esphome/esphome.git
synced 2026-09-21 12:08:38 +00:00
[ethernet] Fix JL1101 on IDF 6.0: pioarduino doesn't have it patched
pioarduino only patches esp_eth_phy_new_jl1101() into IDF 5.4.2-5.x, not IDF 6.0. Update guards in both the .c driver and .h declaration to also compile when IDF >= 6.0. Guard logic: compile custom driver when JL1101 configured AND (IDF >= 6.0 OR IDF < 5.4.2 OR not PlatformIO)
This commit is contained in:
@@ -29,7 +29,8 @@
|
||||
#include "esp_rom_sys.h"
|
||||
#include "esp_idf_version.h"
|
||||
|
||||
#if defined(USE_ETHERNET_JL1101) && (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 4, 2) || !defined(PLATFORMIO))
|
||||
#if defined(USE_ETHERNET_JL1101) && (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0) || \
|
||||
ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 4, 2) || !defined(PLATFORMIO))
|
||||
|
||||
static const char *TAG = "jl1101";
|
||||
#define PHY_CHECK(a, str, goto_tag, ...) \
|
||||
|
||||
@@ -239,7 +239,8 @@ class EthernetComponent : public Component {
|
||||
extern EthernetComponent *global_eth_component;
|
||||
|
||||
#ifdef USE_ESP32
|
||||
#if defined(USE_ETHERNET_JL1101) && (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 4, 2) || !defined(PLATFORMIO))
|
||||
#if defined(USE_ETHERNET_JL1101) && (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0) || \
|
||||
ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 4, 2) || !defined(PLATFORMIO))
|
||||
extern "C" esp_eth_phy_t *esp_eth_phy_new_jl1101(const eth_phy_config_t *config);
|
||||
#endif
|
||||
#endif // USE_ESP32
|
||||
|
||||
Reference in New Issue
Block a user