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

AddressableLED ColorOrder #2329

Closed
wants to merge 7 commits into from

Conversation

Bankst
Copy link
Contributor

@Bankst Bankst commented Feb 1, 2020

No description provided.

Base automatically changed from master to main January 30, 2021 19:54
@PeterJohnson PeterJohnson requested a review from a team as a code owner January 30, 2021 19:54
@Starlight220
Copy link
Member

Starlight220 commented Jan 22, 2023

Three years, do we want to do anything with this? What was this blocked on? (not that I expect anyone to remember...)

@PeterJohnson
Copy link
Member

It needs a C++ version, but the problem is that you can't do a C++ version of this in the same way, since the LEDData class in C++ is a bit-for-bit wrapper around the C structure. We could maybe make a templated LEDData class (or simply separate LEDData classes) to do the different color order variants?

@Starlight220
Copy link
Member

What's the use case for this, anyway?

@Bankst
Copy link
Contributor Author

Bankst commented Jan 23, 2023

What's the use case for this, anyway?

Most COTS led strips are not RGB color order, and many differ from the typical BGR too. I have a few GRB strips

@calcmogul calcmogul added component: wpilibj WPILib Java component: wpilibc WPILib C++ help: needs C++ Java exists, needs C++ port labels Nov 30, 2023
Comment on lines +74 to +76
default -> {
// Unreachable
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://docs.oracle.com/en/java/javase/17/language/switch-expressions.html this shouldn't be required for enums?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, for some reason, a bunch of places in WPILib have default cases for enums anyway.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh weird...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a switch expression, it's still a statement.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The empty default is functionally equivalent to not handling it

@rzblue
Copy link
Member

rzblue commented Aug 9, 2024

Implementing the c++ version via templates is now significantly more difficult due to the LED pattern library.

@PeterJohnson
Copy link
Member

PeterJohnson commented Aug 13, 2024

I think the right answer for this may be to do the color channel swizzling when the buffer is copied to the FPGA, rather than on every write, using NEON SIMD to make it fast using code similar to https://github.com/ermig1979/Simd/blob/master/src/Simd/SimdNeonBgrToRgb.cpp (effectively the same code as discussed here: https://developer.arm.com/documentation/102159/0400/Load-and-store---example-RGB-conversion). We'd want to align and pad out the internal buffers to avoid boundary conditions.

@rzblue
Copy link
Member

rzblue commented Sep 6, 2024

In the interest of preventing duplicated work- I've got the simd solution mostly implemented, just need to take some time and finish up all the little details.

@PeterJohnson
Copy link
Member

Superseded by #7102.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: wpilibc WPILib C++ component: wpilibj WPILib Java help: needs C++ Java exists, needs C++ port
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants