Repository navigation
fix(esp32): link the WiFi stack only when a sketch uses fl::net wifi/OTA (#4726) - #4731
Merged
Merged
Conversation
…OTA (#4726) Split fl::net::OTA and the ESP32 wifi/OTA backends out of the always-linked fl.net+ and platforms+ unity objects into their own build units (fl.net.ota+.cpp, platforms.esp.32.net+.cpp, platforms.esp.32.ota+.cpp). Their strong esp_wifi_init references no longer pull libesp_wifi / libnet80211 into every ESP32 sketch, so NetworkDetector's weak esp_wifi_get_mode check again reports WiFi as not linked in Blink. fl/net/ota.h stays as a forwarding header to fl/net/ota/ota.h. Fixes #4726 Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (15)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4726
Approach
fl::net::OTAand the ESP32 wifi/OTA backends move out of the always-linkedfl.net+/platforms+unity objects into their own build units:fl/build/fl.net.ota+.cpp,platforms.esp.32.net+.cpp,platforms.esp.32.ota+.cpp. Their strongesp_wifi_initreferences reach the linker only when a sketch uses wifi/OTA.IOTA::create()now lives in the ESP32 OTA unit, sofl::net::OTAis what pulls it in. The null-stub guard inplatforms/ota.cpp.hppnow matchesFL_ESP_OTA_SUPPORTEDexactly, including the IDF 6 exclusion.fl/net/ota.his kept as a forwarding header tofl/net/ota/ota.h.fl/build/*.cppwas removed or renamed, andci/check_released_sources.pypasses. The oldfl/net/ota.cpp.hppleft behind by an overlay is a.cpp.hppfile, so it is never compiled.network_detector.cpp.hppis unchanged. Its weakesp_wifi_get_modenow resolves to null in Blink again.Evidence (local fbuild, Blink, flash/RAM in bytes)
esp32-hal-bt->libbt bt.c->phy_init->wifi_init. No libFastLED object references it any more.The OTA example (esp32s3, esp32c6) and AutoResearch (esp32c6) still link
esp_wifi_init,s_wifi_nvsandESP32OTA.The esp32s3 bloat baseline is re-pinned to 367407 (
bash bloat esp32s3 --buildimage_flash, measured locally).Local checks:
bash lintandbash test wifi|ble_notify_queue|portpass.