Repository navigation
Conversation
…xed 10us per byte ESP32RMTLedStrip waited at most 150us + 10us per byte for the previous frame to finish before giving up and dropping the new one. That budget was sized for WS2812B timing with a short reset, so a strip configured with slower bits or a longer reset (CogPro: 14 pixels at 1.3us per bit with a 300us reset, a 737us frame) hit the 570us limit whenever two shows came close together, and the second frame was silently dropped: alternate LEDs stayed dark in a step-through test. The wait is now computed in setup() from the strip's own config: the frame's bits at the longer of the 0 and 1 bit periods, plus the reset, plus a margin (a quarter of the frame time, at least 200us) for the interrupt and the waiting task being late. LEDStripRMTPlan gets frameTimeUs() and showWaitUs() so the arithmetic is host-tested alongside the RMT memory plan. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
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.
Problem
ESP32RMTLedStrip::waitUntilShowComplete()waited at most150us + 10us per bytefor the previous frame to finish.showPixels()calls it when a show arrives while the last frame is still going out, and drops the new frame if the wait times out.That budget assumes WS2812B bit timing and a short reset. A strip configured with slower bits or a longer reset exceeds it: on CogPro, 14 pixels at 1.3 µs per bit with a 300 µs reset is a 737 µs frame against a 570 µs budget. Two shows in one loop pass (one LED off, the next on) lost the second frame every time, so alternate LEDs stayed dark in a step-through test. Nothing was logged.
Change
setup()from the strip's own config: the frame's bits at the longer of the 0 and 1 bit periods, plus the reset, plus a margin for the TX-done interrupt and the waiting task being late (a quarter of the frame time, at least 200 µs).LEDStripRMTPlangetsframeTimeUs()andshowWaitUs()so the arithmetic is Raft-free and host-tested next to the RMT memory plan.DEBUG_ESP32RMTLEDSTRIP_SETUPlog now shows the frame time and the wait.No config keys change. For WS2812B defaults the wait is close to what it was (a 14-pixel frame: 504 µs frame, 704 µs wait, versus 570 µs before); for longer resets or slower parts it grows to fit the frame.
Testing
make -C linux_unit_tests test_led_strip_rmt_plan: 261 checks pass, including the newtestFrameTimeUs(WS2812B defaults, the CogPro timing that failed, 20 MHz ticks, a 300-pixel RGBWW strip, and the wait margin).raftdevlibs/RaftCore.🤖 Generated with Claude Code