Repository navigation
refactor(autoresearch): hide platform detection and serial config behind fl/system helpers - #5514
Merged
Merged
Conversation
…ind fl/system helpers
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 5 minutes. View limit details
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. |
Contributor
Memory usage (this PR vs. its merge base)Change in
|
28 of 30 tasks
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.
Summary
Addresses #5492 item #28 (and #4720): moves platform detection and serial buffer/timeout configuration out of
examples/AutoResearch/behind platform-neutralsrc/fl/system/helpers so sketch code avoids direct#ifdefplatform ladders and rawSerial.setRxBufferSize/Serial.setTxTimeoutMscalls.Changes
src/fl/system/platform_info.h: Addsfl::platformName()returning a canonical compile-time string for all supported FastLED targets (ESP32 variants, Teensy, RP2040/RP2350, LPC845, STM32, nRF52, SAMD, AVR, WASM, stub/host).src/fl/system/serial_config.h: Adds zero-overhead inline wrappersfl::serial_set_buffer_sizes(rx, tx)andfl::serial_set_tx_timeout_ms(ms)(no-op on platforms without those methods, avoiding AVR Blink flash/RAM impact).examples/AutoResearch/AutoResearchPlatform.h&AutoResearch.ino: DelegateschipName()tofl::platformName(), introducesdefaultSerialWaitMs()anddefaultRxBufferSize(), and replaces raw platform#ifdefblocks and// ok serialworkarounds insetup()with thefl/systemhelpers.tests/unit/fl/system/platform_info.cpp: Adds unit tests coveringfl::platformName(),fl::serial_set_buffer_sizes(), andfl::serial_set_tx_timeout_ms().Verification
bash lint src/fl/system/platform_info.h src/fl/system/serial_config.h tests/unit/fl/system/platform_info.cpp examples/AutoResearch/AutoResearchPlatform.h examples/AutoResearch/AutoResearch.ino— PASSbash test platform_info --debug— 1/1 PASSbash compile esp32c6 AutoResearch— PASS (fbuild, 0 errors)