Skip to content

fix(teensy4): share ObjectFLED singleton, restore pin warnings (#4617 follow-up) - #4624

Merged
zackees merged 1 commit into
masterfrom
fix/teensy4-slim-bridge-review
Sep 25, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/teensy4-slim-bridge-review

Conversation

@zackees

@zackees zackees commented Sep 25, 2026

Copy link
Copy Markdown
Member

Follow-up to merged #4617 (#4599), addressing code-review findings.

1. Duplicate OBJECT_FLED engine. addObjectFLEDIfPossible built its own ChannelEngineObjectFLED at priority 5 while the legacy slim bridge registers BusTraits<Bus::FLEX_IO,0>::instancePtr() at priority 4, so the first addLeds<> replaced the driver ("Replacing existing driver 'OBJECT_FLED'"), destroying queued Channel-API data. Init now calls BusTraits<Bus::FLEX_IO,0>::registerWithManager() — one singleton, one priority (4, still below SPI 6-7 and FlexIO 8), matching RP/LPC init.

2. Duplicate-pin protection. ChannelEngineObjectFLED::enqueue rejects a second channel on a pin already queued this frame (not marked in-use) with a one-time FASTLED ERROR: Pin X is already in use - strip disabled warning. Linear scan over the queue, per-pin u64 latch: no allocation.

3. Invalid pin warning. The FL_LOG_OBJECTFLED-only log is back to a one-time default-build FL_WARN ("Strip on pin X is INVALID and has been disabled" + validator message).

Verification

Hardware validation still deferred to #4623. Singleton sharing (finding 1) has no cheap host test because the Teensy init TU is not built on host.

🤖 Generated with Claude Code

…follow-up)

Follow-up to #4617 (issue #4599) review findings:
- Teensy init now registers BusTraits<Bus::FLEX_IO,0>'s singleton instead
  of a second ChannelEngineObjectFLED, so the first legacy addLeds<> no
  longer replaces the Channel-API engine and drops its queued data.
- ChannelEngineObjectFLED::enqueue rejects a second strip on an
  already-queued pin with a one-time FL_WARN (old proxy behaviour).
- Invalid pins emit a one-time default-build FL_WARN again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@zackees
zackees merged commit 2990b61 into master Sep 25, 2026
68 of 70 checks passed
@zackees
zackees deleted the fix/teensy4-slim-bridge-review branch September 25, 2026 05:07
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Sep 25, 2026
@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: FastLED/FastLED/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: f090028f-4814-4b2c-b955-f22f3bfc2a05

📥 Commits

Reviewing files that changed from the base of the PR and between cfd04d2 and 2b2956a.

📒 Files selected for processing (4)
  • src/platforms/arm/teensy/teensy4_common/drivers/objectfled/channel_engine_objectfled.cpp.hpp
  • src/platforms/arm/teensy/teensy4_common/drivers/objectfled/channel_engine_objectfled.h
  • src/platforms/arm/teensy/teensy4_common/init_channel_driver_mxrt1062.cpp.hpp
  • tests/platforms/arm/teensy/teensy4_common/drivers/objectfled/channel_engine_objectfled.cpp
 ________________________________________
< I'm a lean, mean, code review machine. >
 ----------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

zackees added a commit that referenced this pull request Sep 25, 2026
…th (#4625)

#4624 put the one-time invalid-pin FL_WARN inside startTimingGroup(),
which is a protected autoresearch-runtime-output region, so `bash lint`
failed on master. Validate and warn once per pin in enqueue() instead;
startTimingGroup() keeps its FL_LOG_OBJECTFLED skip. Follow-up to #4617.

Co-authored-by: Claude Opus 5.5 <[email protected]>
zackees added a commit that referenced this pull request Sep 25, 2026
- ObjectFLED: re-enqueueing the same strip before show() is a silent
  no-op, not a false 'pin already in use' error.
- FlexIO init registers the BusTraits<FLEX_IO,1> singleton instead of a
  second engine that later registration would replace.
- Fix stale ObjectFLED priority comment (4, not 5).

Follow-up to #4624 / #4599.

Co-authored-by: Claude Opus 5.5 <[email protected]>
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