Skip to content
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

Use structs for reordering #7

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chmanie
Copy link

@chmanie chmanie commented Nov 30, 2024

This PR uses marker structs to set the color order. This should save one match statement as the Color order is determined at compile time (which can be assumed as the Led ordering should not change during runtime).

Usage now would be:

use ws2812_async::{Ws2812, Grb};
let mut ws: Ws2812<_, Grb, { 12 * 18 }> = Ws2812::new(spi);

The rest of the API stays the same (except that there's no set_color_order method anymore).

Furthermore I allowed myself to also implement the preliminary async smart-leds-trait from here: smart-leds-rs/smart-leds-trait#13

Let me know what you think!

Note: the Cargo.toml still references my fork of the smart-leds-trait. Let's hope the async trait will be added in the next version, so that we can reference it properly.

Closes #3

This also implements the preliminary version of the smart-leds async trait
@chmanie chmanie marked this pull request as draft November 30, 2024 14:41
@chmanie
Copy link
Author

chmanie commented Nov 30, 2024

I converted it into a draft PR until smart-leds-rs/smart-leds-trait#13 is merged and released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

impl SmartLedsWriter
1 participant