From c9cba2b07024b00b8fab713401b38badb6ba4db5 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 14 Mar 2026 15:18:02 -1000 Subject: [PATCH] [ethernet] Fix clang-tidy errors in ESP32 ethernet - Add CONFIG_ETH_SPI_ETHERNET_W5500, CONFIG_ETH_SPI_ETHERNET_DM9051, CONFIG_ETH_USE_ESP32_EMAC to defines.h for clang-tidy visibility - Fix %lu format to PRIu32 for polling_interval_ --- esphome/components/ethernet/ethernet_component_esp32.cpp | 2 +- esphome/core/defines.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/esphome/components/ethernet/ethernet_component_esp32.cpp b/esphome/components/ethernet/ethernet_component_esp32.cpp index 58c67a32ca1..ac8680f3e13 100644 --- a/esphome/components/ethernet/ethernet_component_esp32.cpp +++ b/esphome/components/ethernet/ethernet_component_esp32.cpp @@ -408,7 +408,7 @@ void EthernetComponent::dump_config() { this->clk_pin_, this->miso_pin_, this->mosi_pin_, this->cs_pin_); #ifdef USE_ETHERNET_SPI_POLLING_SUPPORT if (this->polling_interval_ != 0) { - ESP_LOGCONFIG(TAG, " Polling Interval: %lu ms", this->polling_interval_); + ESP_LOGCONFIG(TAG, " Polling Interval: %" PRIu32 " ms", this->polling_interval_); } else #endif { diff --git a/esphome/core/defines.h b/esphome/core/defines.h index 94fafe09827..b7a298eab6d 100644 --- a/esphome/core/defines.h +++ b/esphome/core/defines.h @@ -281,6 +281,9 @@ #define USE_ETHERNET_SPI #define USE_ETHERNET_SPI_POLLING_SUPPORT #define USE_ETHERNET_OPENETH +#define CONFIG_ETH_SPI_ETHERNET_W5500 1 +#define CONFIG_ETH_SPI_ETHERNET_DM9051 1 +#define CONFIG_ETH_USE_ESP32_EMAC 1 #define USE_ETHERNET_MANUAL_IP #define USE_ETHERNET_IP_STATE_LISTENERS #define USE_ETHERNET_CONNECT_TRIGGER