From 50b6f74295e6361c55e21febab23190e7d84ce5a Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Tue, 12 Nov 2024 21:49:36 +0100 Subject: [PATCH] Better check for existing Ethernet support in Arduino libs (#22473) * use IDF var for eth check --- tasmota/include/tasmota_configurations_ESP32.h | 8 +++++--- tasmota/tasmota_xdrv_driver/xdrv_82_esp32_ethernet.ino | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tasmota/include/tasmota_configurations_ESP32.h b/tasmota/include/tasmota_configurations_ESP32.h index 9eb52a7b5..e4d714325 100644 --- a/tasmota/include/tasmota_configurations_ESP32.h +++ b/tasmota/include/tasmota_configurations_ESP32.h @@ -189,10 +189,12 @@ #undef USE_ESP32_WDT // disable watchdog on SAFEBOOT until more testing is done #if CONFIG_FREERTOS_UNICORE || CONFIG_IDF_TARGET_ESP32S3 +#if CONFIG_ETH_ENABLED // Check for Ethernet support in Arduino libs // #undef USE_MQTT_TLS // #define USE_SERIAL_BRIDGE // Add support for software Serial Bridge console Tee (+4.5k code) #define USE_SPI // Make SPI Ethernet adapters useable (+124 bytes) #define USE_ETHERNET +#endif // CONFIG_ETH_ENABLED #endif // CONFIG_FREERTOS_UNICORE || CONFIG_IDF_TARGET_ESP32S3 #endif // FIRMWARE_SAFEBOOT @@ -830,15 +832,15 @@ #endif // USE_MATTER_DEVICE /*********************************************************************************************\ - * Post-process compile options for esp32-c2 + * Post-process for switched off Ethernet support in Arduino static libs \*********************************************************************************************/ -#ifdef CONFIG_IDF_TARGET_ESP32C2 +#ifndef CONFIG_ETH_ENABLED #undef USE_ETHERNET #ifdef FIRMWARE_MINIMAL #undef USE_SPI #endif // FIRMWARE_MINIMAL -#endif // CONFIG_IDF_TARGET_ESP32C2 +#endif // CONFIG_ETH_ENABLED #endif // ESP32 #endif // _TASMOTA_CONFIGURATIONS_ESP32_H_ diff --git a/tasmota/tasmota_xdrv_driver/xdrv_82_esp32_ethernet.ino b/tasmota/tasmota_xdrv_driver/xdrv_82_esp32_ethernet.ino index 6a40129ef..5fb4712c5 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_82_esp32_ethernet.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_82_esp32_ethernet.ino @@ -18,7 +18,8 @@ */ #ifdef ESP32 -#ifndef CONFIG_IDF_TARGET_ESP32C2 +#include "sdkconfig.h" +#ifdef CONFIG_ETH_ENABLED #ifdef USE_ETHERNET /*********************************************************************************************\ * Ethernet support for ESP32