Skip to content

refactor(autoresearch): hide platform detection and serial config behind fl/system helpers - #5514

Merged
zackees merged 1 commit into
masterfrom
refactor/autoresearch-platform-neutrality
Dec 3, 2026
Merged

zackees merged 1 commit into
masterfrom
refactor/autoresearch-platform-neutrality

Conversation

@zackees

@zackees zackees commented Dec 3, 2026

Copy link
Copy Markdown
Member

Summary

Addresses #5492 item #28 (and #4720): moves platform detection and serial buffer/timeout configuration out of examples/AutoResearch/ behind platform-neutral src/fl/system/ helpers so sketch code avoids direct #ifdef platform ladders and raw Serial.setRxBufferSize/Serial.setTxTimeoutMs calls.

Changes

  • src/fl/system/platform_info.h: Adds fl::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 wrappers fl::serial_set_buffer_sizes(rx, tx) and fl::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: Delegates chipName() to fl::platformName(), introduces defaultSerialWaitMs() and defaultRxBufferSize(), and replaces raw platform #ifdef blocks and // ok serial workarounds in setup() with the fl/system helpers.
  • tests/unit/fl/system/platform_info.cpp: Adds unit tests covering fl::platformName(), fl::serial_set_buffer_sizes(), and fl::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 — PASS
  • bash test platform_info --debug — 1/1 PASS
  • bash compile esp32c6 AutoResearch — PASS (fbuild, 0 errors)

@coderabbitai

coderabbitai Bot commented Dec 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b034337 and bae0e69.

Files selected for processing: 5

  • examples/AutoResearch/AutoResearch.ino
  • examples/AutoResearch/AutoResearchPlatform.h
  • src/fl/system/platform_info.h
  • src/fl/system/serial_config.h
  • tests/unit/fl/system/platform_info.cpp
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Memory usage (this PR vs. its merge base)

Change in examples/Blink per target. The left number is this PR's image flash / attributed RAM in bytes; the colored delta is the change from the merge base (red ↑ is larger, green ↓ is smaller, Same is unchanged).

Target FLASH [bytes] RAM [bytes]
attiny85 2,460 (Same) 136 (Same)

@zackees
zackees added this pull request to the merge queue Dec 3, 2026
Merged via the queue into master with commit e3b4aff Dec 3, 2026
132 checks passed
@zackees
zackees deleted the refactor/autoresearch-platform-neutrality branch December 3, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant