Skip to content

fix(autoresearch): address three lint violations in AutoResearchLowMemory.h (#3041 follow-up) - #3047

Merged
zackees merged 1 commit into
masterfrom
fix/3041-autoresearch-low-memory-lint
Jun 14, 2026
Merged

fix(autoresearch): address three lint violations in AutoResearchLowMemory.h (#3041 follow-up)#3047
zackees merged 1 commit into
masterfrom
fix/3041-autoresearch-low-memory-lint

Conversation

@zackees

@zackees zackees commented Jun 14, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to #3041. Three lint violations in examples/AutoResearch/AutoResearchLowMemory.h:

  • ExampleSerialChecker — swapped Serial.begin(115200) for the HWCDC-safe fl::serial_begin(115200) (FastLED fix(esp32c6): route Serial to HWCDC + non-blocking writes (#2665) #2669).
  • PlatformIncludesChecker — suppressed with // ok platform headers since the is_lpc.h deep include gates the RX SCT driver path on real LPC builds vs. the example DLL host-stub.
  • StaticInHeaderChecker — function-local static fl::Remote remote(...) in an inline function is intended (single shared instance via inline-ODR); suppressed with the checker's canonical // okay static in header marker.

bash lint --cpp is clean.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Improved cross-platform header gating to enable compilation on host stub builds while preserving platform-specific functionality for real target deployments.
  • Refactor

    • Updated serial communication initialization to use standardized API method.
  • Documentation

    • Enhanced code comments to clarify static instance initialization behavior and memory management patterns.

…mory.h (#3041 follow-up)

PR #3041 retired AutoResearchLpc.ino into a header on the AutoResearch
side, but the LPC sketch's patterns (Serial.begin, deep platform include,
function-local static fl::Remote) tripped the example-side lint:

  * ExampleSerialChecker -- `Serial.begin(115200)` -> `fl::serial_begin(115200)`
    so the HWCDC-safe wrapper from #2669 (setTxTimeoutMs=0 + guarded flush
    + host-presence skip) is what runs on the LPC845 USART link instead
    of the raw HardwareSerial path.
  * PlatformIncludesChecker -- the `#include "platforms/arm/lpc/is_lpc.h"`
    is intentional (the RX SCT driver only exists on real LPC builds; the
    example DLL host-stub still has to compile this header). Suppressed
    inline with `// ok platform headers - LPC RX driver gate`.
  * StaticInHeaderChecker -- `static fl::Remote remote(...)` inside
    `autoResearchLowMemorySetup()` lifts to a single shared instance
    via the inline-ODR rule, which is the intended behavior. Suppressed
    with the canonical `// okay static in header` marker the checker
    recognises.

`bash lint --cpp` is clean after this commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zackees
zackees merged commit e51220e into master Jun 14, 2026
5 of 7 checks passed
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 36b55a0b-fd96-41cb-acaf-ee6efade7edc

📥 Commits

Reviewing files that changed from the base of the PR and between 17e1828 and f4d768b.

📒 Files selected for processing (1)
  • examples/AutoResearch/AutoResearchLowMemory.h

📝 Walkthrough

Walkthrough

AutoResearchLowMemory.h adds an include for fl/stl/cstdio.h, gates the LPC platform header behind a host-stub guard, replaces Serial.begin(115200) with fl::serial_begin(115200), and adds clarifying comments around the static fl::Remote singleton initialization.

Changes

AutoResearchLowMemory Host-Stub Compatibility

Layer / File(s) Summary
Include guards, cstdio, and serial API migration
examples/AutoResearch/AutoResearchLowMemory.h
Adds fl/stl/cstdio.h include and gates platforms/arm/lpc/is_lpc.h so host-stub builds compile. Replaces Serial.begin(115200) with fl::serial_begin(115200). Expands comments on the static fl::Remote initialization to document single-instance/ODR intent; no logic change.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • FastLED/FastLED#2679: Migrates AutoResearch.ino from raw Serial.begin(...) to fl::serial_begin(...), the same API migration applied here to AutoResearchLowMemory.h.

Poem

🐇 A bunny hops through include guards with glee,
No more bare Serial calls — fl::serial_begin is free!
LPC headers gated, the stubs compile clean,
The remote singleton comments explain what they mean.
Hop hop, little sketch, now build without a fuss! 🌟

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/3041-autoresearch-low-memory-lint

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jun 14, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 14, 2026
@zackees
zackees deleted the fix/3041-autoresearch-low-memory-lint branch August 21, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant