- 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_
Add W5500 SPI Ethernet support for RP2040 boards using arduino-pico's
Wiznet5500lwIP class. Tested on WIZnet W5500-EVB-Pico hardware.
- Add ethernet_component_rp2040.cpp with W5500 implementation
- Add RP2040 members and setters to ethernet_component.h
- Enable RP2040 platform in SPI_SCHEMA and FILTER_SOURCE_FILES
- Add RP2040 validation, code generation, and lwIP_w5500 library
- Add W5500 RP2040 test YAML
Restructure the ethernet component from ESP32-only to multi-platform,
following the same pattern as the wifi component (FILTER_SOURCE_FILES
with platform-specific .cpp files).
- Split ethernet_component.cpp into common code + ethernet_component_esp32.cpp
- Remove DEPENDENCIES = ["esp32"], add platform validators per type
- Add FILTER_SOURCE_FILES to select platform-specific .cpp
- Move ESP32 imports inside platform-conditional functions
- Update ethernet_info guards from USE_ESP32 to USE_ETHERNET
- Add USE_ETHERNET_SPI/OPENETH/SPI_POLLING_SUPPORT to defines.h
- Guard ethernet_helpers.c with USE_ESP32
No behavioral changes for ESP32 — this is a pure restructuring to
enable adding non-ESP32 platform support.
Restructure the ethernet component from ESP32-only to multi-platform,
following the same pattern as the wifi component (FILTER_SOURCE_FILES
with platform-specific .cpp files).
- Split ethernet_component.cpp into common code + ethernet_component_esp32.cpp
- Remove DEPENDENCIES = ["esp32"], add platform validators per type
- Add FILTER_SOURCE_FILES to select platform-specific .cpp
- Move ESP32 imports inside platform-conditional functions
- Update ethernet_info guards from USE_ESP32 to USE_ETHERNET
- Add USE_ETHERNET_SPI/OPENETH/SPI_POLLING_SUPPORT to defines.h
- Guard ethernet_helpers.c with USE_ESP32
No behavioral changes for ESP32 — this is a pure restructuring to
enable adding non-ESP32 platform support.
Restructure the ethernet component from ESP32-only to multi-platform,
following the same pattern as the wifi component (FILTER_SOURCE_FILES
with platform-specific .cpp files).
- Split ethernet_component.cpp into common code + ethernet_component_esp32.cpp
- Remove DEPENDENCIES = ["esp32"], add platform validators per type
- Add FILTER_SOURCE_FILES to select platform-specific .cpp
- Move ESP32 imports inside platform-conditional functions
- Update ethernet_info guards from USE_ESP32 to USE_ETHERNET
- Add USE_ETHERNET_SPI/OPENETH/SPI_POLLING_SUPPORT to defines.h
- Guard ethernet_helpers.c with USE_ESP32
No behavioral changes for ESP32 — this is a pure restructuring to
enable adding non-ESP32 platform support.
Move FreeRTOS Mutex methods inline into helpers.h, eliminating
duplicate out-of-line definitions in esp32/helpers.cpp and
libretiny/helpers.cpp.
Hot path impact (disassembled from ELF):
| Platform | Before | After | Saved |
|--------------------|----------|----------|---------|
| ESP32 (Xtensa) | 1304 B | 1270 B | -34 B |
| BK72xx (ARM M4) | 1400 B | 1396 B | -4 B |
| RTL87xx (ARM M33) | 1248 B | 1246 B | -2 B |
| ESP32-C3 (RISC-V) | 1498 B | 1494 B | -4 B |
GCC generates ISRA clones that hoist the handle_ load into callers
and use tail calls to xQueueSemaphoreTake/xQueueGenericSend.
The fast path (millis + subtract + compare) is tiny and called once
per component per loop iteration. Moving it inline eliminates a
call8/retw pair per component, reducing main loop overhead.
The cold warning path (warn_if_blocking) and runtime stats recording
remain out-of-line in component.cpp.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The fast path (millis + subtract + compare) is tiny and called once
per component per loop iteration. Moving it inline eliminates a
call8/retw pair per component, reducing main loop overhead.
The cold warning path (warn_if_blocking) and runtime stats recording
remain out-of-line in component.cpp.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add APIBuffer::reserve_and_resize() to eliminate duplicate grow_()
capacity checks when reserve() is immediately followed by resize().
This saves one grow_() check per call site (~12 bytes each).
Simplify set_nodelay_for_message() Nagle batching state machine by
replacing the NODELAY_ON (-1) sentinel with a simple counter starting
at 0. Reduces branches from 5 to 3 with identical behavior verified
by exhaustive testing of all 2^N message sequences up to length 12.
Saves 32 bytes flash on ESP8266.
ESP-IDF places log_format_text.c in IRAM/DRAM via linker fragment
(noflash) when CONFIG_LOG_IN_IRAM=y. Our override is in a different
compilation unit so string literals would default to flash. In
constrained environments where flash cache is disabled, reading
flash-resident format strings would fault.
Move all format string constants to DRAM_ATTR to match ESP-IDF's
own behavior.
Switch from ESP-IDF Log V1 to V2, which centralizes log formatting
inside esp_log() instead of expanding esp_log_timestamp(), color codes,
and LOG_FORMAT() at every ESP_LOGx macro call site.
This saves ~9KB of flash by eliminating ~500 per-site macro expansions
in ESP-IDF library code (gpio, ethernet, mdns, uart, wifi, etc.).
Override esp_log_format() to skip ESP-IDF's own formatting after the
ESPHome logger hook is installed, since ESPHome does its own formatting.
For early boot and constrained environments (ISR, cache disabled),
format messages in ESPHome style with colors using a stack buffer.