-
-
Notifications
You must be signed in to change notification settings - Fork 8
Re-architect to pre-calculate a buffer for each frame #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
Owner
Author
Owner
Author
This reverts commit 1111a4f.
343e823 to
b282cb5
Compare
This was referenced Oct 14, 2025
ahdinosaur
added a commit
that referenced
this pull request
Oct 15, 2025
Now if you have a small enough number of clockless (i.e. WS2812) LEDs where a whole frame can fit within an RMT buffer, then the LED output will have no gaps. Closes #86. - Upgrade to `[email protected]` - Use `esp_hal::rmt::CHANNEL_RAM_SIZE` instead of hard-coded 64 - On async, the timing gap must be too much as the cube doesn't work, so reduce to a single LED (8 * channels_count + 1), but even that seems to be wrong in a weird way. - Fix bug with RMT driver - If you set memsize, then an RMT write would only write that much data. - Was introduced and fixed in #90, but then accidentally re-introduced before merge.
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.







π©βπ¬ π§ͺ π₯
If we can off-load sending bits to the LEDs using hardware, then we can prepare the bits for the next frame while the current frame is being sent.
This pull request is a big step towards making this possible.
One realization to make this work is that yes the
generic_const_exprsfeature would make no-alloc much nicer, BUT IN THE MEANTIME we can achieve the same outcomes (with a worse user experience) by using generic constants without expressions. Since you can't do constant calculations using generics (e.g. we can't calculate the buffer size needed using other generic types we already have, such as the type of LED which has a constant function for this), the user must calculate them on their side and pass in to your type arguments. We can use all our builder pattern skills to make this as ergonomic as possible.Changes:
Driver(andDriverAsync) trait interfacegeneric_const_exprsfeature is stable, we aren't able to use associated constants, const functions, or expressions in the Blinksy code to calculate constants at compile-time. Instead, we must receive pre-calculated constants from the user as a generic. The best we can do is make it easy as possible by providing good types, traits, and const functions for the user to use.Control, you now need to provide aFRAME_BUFFER_SIZEconstant.ClocklessDriverandClockedDriver.crate::ledsmodule, removeLedsuffix from structs.