You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ESP32: WiFi stack linked into Blink via esp_wifi_init in the platforms+ unity object (~3 KB flash, ~1.6 KB RAM) #4726
Two strong references to esp_wifi_init sit in the always-linked platforms+ unity object: platforms/esp/32/net/wifi_esp32.cpp.hpp (the fl::net::wifi API) and platforms/esp/32/ota/ota_impl.cpp.hpp. They pull wifi_init.c.obj out of the archive. That makes the weakesp_wifi_get_mode that NetworkDetector::isWiFiActive() (rmt_5/network_detector.cpp.hpp) checks resolve to a real function. FastLED.show(), the channel manager and the RMT driver call that function on every frame, so the WiFi code it reaches stays linked.
There is also a behaviour side effect: the "is WiFi linked?" weak-symbol check now always returns "linked", so isWiFiActive() always makes a real esp_wifi_get_mode call, even in sketches that never use WiFi.
A small related item: static fl::vector<fl::unique_ptr<EspRouteContext>> s_esp_route_contexts in fl/stl/asio/http/server.cpp.hpp is a namespace-scope object with a dynamic initializer, so its vector ops link into every ESP32 sketch (about 150 B).
Possible ways forward
Move the WiFi/OTA implementations out of the always-linked unity object, for example into their own archive member that links only when fl::net::wifi::* or the OTA API is called. Keep NetworkDetector's weak references.
Activity
test(bloat): re-pin esp32s3 Blink baseline to 367407 B (#4726)
fix(esp32): link the WiFi stack only when a sketch uses fl::net wifi/…
perf(esp32s3): link the ADC driver only when fl::analogRead is used (#…
feat(esp8266): OTA via the core's ArduinoOTA, in its own component TU (…