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

add ws2813 timings support #510

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add ws2813 timings support #510

wants to merge 1 commit into from

Conversation

sir-go
Copy link

@sir-go sir-go commented Dec 16, 2022

@Gadgetoid
Copy link
Collaborator

I don't have any access to ws2813 LEDs to sign this off, so if anyone else has got some and willing to give it a shot it would be much appreciated.

Will need to regression test, too, since this changes some pretty fundamental stuff in the main thrust of the code that I only sometimes understand, on a good day.

Seems the main thrust is that a nibble instead of three bits gives you the extra timing resolution you need for ws2813, but does it maintain the ratios required for ws2812/ws2811?

@Gadgetoid
Copy link
Collaborator

Note also that this change conflicts #468, which I have just merged but I think you can probably accomplish pretty much the same thing starting from there.

It was on my TODO list to refactor or document that code to make it a little easier to understand, but I don't think it's too onerous.

I suspect we could probably rustle up a Python script to produce the relevant timing tables, except now with your 4 bits instead of the original 3 I think my proposal to pack as a uint32 makes a lot more sense.

My other concern for this change would be performance. If ws2811 and ws2812 pixels currently work with 3-bit symbols then adding a fourth bit makes them slower (in theory, in practise it might just mean that the hardware is clocked slightly higher to achieve the exact same timings but the timings do have some wiggle room IIRC) but this precomputed table update probably cancels that out and then some.

Anyway- thank you for taking the time to make and PR this change, and sorry I'm moving the goal posts!

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.

2 participants