Skip to content

fix(objectfled): preserve the active frame on show timeout - #5488

Merged
zackees merged 1 commit into
masterfrom
fix/objectfled-in-flight-timeout
Nov 25, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/objectfled-in-flight-timeout

Conversation

@zackees

@zackees zackees commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Related to #5356.

When a Teensy ObjectFLED show() times out waiting for the active DMA frame, drop the newly queued frame and let poll() finish the active transfer. A channel queued again while it is still transmitting keeps its in-use flag until the active transfer completes.

The host regression holds DMA busy across a second show(). It reproduced an unexpected second submission before the fix and now verifies that the original frame drains, newly queued buffers are released, and a later frame can start. The focused ASan/UBSan run and changed-file lint passed. Full C++ validation is running. No Teensy was available for a physical loopback run.

Summary by CodeRabbit

  • Bug Fixes
    • Prevented new frames from starting while the driver is still processing an active frame. Queued channels remain available to send once the driver is ready again.

@zackees zackees added the ci-platform:teensy41 Select FastLED board CI cells label Nov 25, 2026
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized key: "enabled" at "reviews.pre_merge_checks"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

No actionable comments were generated in the recent review.

Walkthrough

When waitForReady() fails, show() now releases queued channels that are not transmitting, clears the enqueue queue, and returns without starting the frame. A unit test checks channel state and peripheral instance creation during frame draining.

Changes: Teensy 4 ObjectFLED readiness handling

Layer / File(s) Summary
Handle show() while the driver is busy
src/platforms/arm/teensy/teensy4_common/drivers/objectfled/channel_engine_objectfled.cpp.hpp, tests/unit/platforms/arm/teensy/teensy4_common/drivers/objectfled/channel_engine_objectfled.cpp
show() now returns when waitForReady() fails and releases queued channels that are not transmitting. The test checks that the active channel remains in use, the new channel remains unused, and a second peripheral instance is created only after the queued channel is shown again.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to 044ab

This change stops a second frame from being submitted while the active Teensy ObjectFLED DMA transfer is still draining, and it adds a regression test for that case. No remaining merge-blocking issues were found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(objectfled): preserve the active frame on show timeout" matches the main change. The objectives say show() timing out while a DMA frame is active should drop the newly queued frame and …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(objectfled): preserve the active frame on show timeout" matches the main change. The objectives say show() timing out while a DMA frame is active should drop the newly queued frame and let poll() finish the active transfer. The summary confirms show() now checks waitForReady() and returns without starting the new frame when not ready, and a test covers the active frame being kept. The title names the component, the fix type, and the behavior being preserved, so it is specific and accurate.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 60afab9 and 044ab5d.

Files selected for processing: 2

  • src/platforms/arm/teensy/teensy4_common/drivers/objectfled/channel_engine_objectfled.cpp.hpp
  • tests/unit/platforms/arm/teensy/teensy4_common/drivers/objectfled/channel_engine_objectfled.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

@github-actions

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)
teensy41 46,080 (Same) 21,738 (Same)

@zackees
zackees added this pull request to the merge queue Nov 25, 2026
Merged via the queue into master with commit dc12654 Nov 25, 2026
262 of 275 checks passed
@zackees
zackees deleted the fix/objectfled-in-flight-timeout branch November 25, 2026 17:04
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-platform:teensy41 Select FastLED board CI cells

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant