The BK7231N Thumb-1 compiler inlines this function 3 times into
cancel_item_locked_, bloating it from ~140 B to 666 B. ESP32 and
RTL8720CF compilers already outline it, so this attribute only
affects BK7231N. Saves ~486 B of flash.
USE_ESP32 and USE_LIBRETINY are compiler flags (-D) always available
to .c files. USE_LWIP_FAST_SELECT is in the generated defines.h which
may not be force-included for .c files on all build systems. Use
platform flags directly in the .c file; .cpp/.h files continue using
USE_LWIP_FAST_SELECT from the generated defines.
Extend the ESP32 lwip_select() replacement (direct rcvevent reads +
FreeRTOS task notifications) to all LibreTiny platforms (bk72xx,
rtl87xx, ln882h).
All LibreTiny platforms have LwIP >= 2.1.3 with
lwip_socket_dbg_get_socket() and FreeRTOS task notifications. The
thread safety argument is actually stronger on LibreTiny since all
platforms are single-core ARM Cortex-M, eliminating cross-core
memory ordering concerns entirely.
Introduces USE_LWIP_FAST_SELECT feature define (set from Python
codegen for ESP32 and LibreTiny) replacing per-platform USE_ESP32
guards. The only platform-specific difference is FreeRTOS header
paths (freertos/FreeRTOS.h on ESP-IDF vs FreeRTOS.h on LibreTiny).
Expected impact on LibreTiny (same as ESP32):
- ~17x faster socket polling (direct rcvevent vs lwip_select)
- ~3.5 KB flash savings (dead code elimination of lwip_select)
- ~56 bytes static RAM savings (fd_set members excluded)
- ~200-300 bytes heap savings (UDP wake socket eliminated)
The color_interlock parameter was accepted but never read in
current_values_as_rgb and current_values_as_rgbw — a leftover
from when it was forwarded to LightColorValues::as_rgb().
On ESP32, replace lwip_select() in yield_with_select_() with direct
socket event reads via lwip_socket_dbg_get_socket(), reducing poll
cost from 133us to ~7us (18.7x faster). Replace the UDP loopback
wake socket with FreeRTOS task notifications (<2us, ISR-safe).
Benchmarks (ESP32, 4 listen sockets):
- Poll path: 7,087 ns vs 132,402 ns (18.7x faster)
- Wake signal: 1,826 ns vs ~130,000 ns (72x faster, now ISR-safe)
- Binary: yield_with_select_ 108B vs 188B (43% smaller)
Non-ESP32 platforms (LibreTiny, ESP8266, RP2040) are unchanged.