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

feat(led_strip): Support more pixel orders of 3 colors (IEC-126) #344

Merged

Conversation

Kainarx
Copy link
Contributor

@Kainarx Kainarx commented Jun 20, 2024

Checklist

  • Component contains License
  • Component contains README.md
  • Component contains idf_component.yml file with url field defined
  • Component was added to upload job
  • Component was added to build job
  • Optional: Component contains unit tests
  • CI passing

Change description

Closes #341

@github-actions github-actions bot changed the title feat(led_strip): Support more pixel orders of 3 colors feat(led_strip): Support more pixel orders of 3 colors (IEC-126) Jun 20, 2024
@Kainarx Kainarx force-pushed the feat/led_strip_support_more_bytes_orders branch from 5e93906 to 65e14f5 Compare June 20, 2024 06:07
@igrr igrr requested a review from suda-morris July 11, 2024 16:13
Copy link
Contributor

@robertlipe robertlipe left a comment

Choose a reason for hiding this comment

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

I'm not a reviewer, so addressing my input isn't required.

I do have some ideas on performance (don't recompute per pixel what you can compute at construction time) as well as some maintainability/readability feedback just from a drive-by on this code.

Thank you for making it more awesome

led_strip/src/led_strip_rmt_dev.c Outdated Show resolved Hide resolved
led_strip/src/led_strip_rmt_dev.c Outdated Show resolved Hide resolved
led_strip/src/led_strip_rmt_dev_idf4.c Outdated Show resolved Hide resolved
@robertlipe
Copy link
Contributor

After all that, you silently withdraw the PR?

I get that it's been open for a month while being ignored by the maintainers, but IMO this is work worth picking up and if you're just exhausted trying to get it in, I may run with it (adding a second white channel) but based on my recent experience trying to change IDF, I'm not at all sure that I wouldn't just rather fork it and maintain it myself and bypass the reviewer clique.

Why was this dropped?

@suda-morris suda-morris reopened this Aug 20, 2024
led_strip/src/led_strip_rmt_dev.c Fixed Show fixed Hide fixed
led_strip/src/led_strip_rmt_dev.c Fixed Show fixed Hide fixed
led_strip/src/led_strip_rmt_dev.c Fixed Show fixed Hide fixed
led_strip/src/led_strip_rmt_dev.c Fixed Show fixed Hide fixed
led_strip/src/led_strip_rmt_dev.c Fixed Show fixed Hide fixed
led_strip/src/led_strip_spi_dev.c Fixed Show fixed Hide fixed
led_strip/src/led_strip_spi_dev.c Fixed Show fixed Hide fixed
@Kainarx Kainarx force-pushed the feat/led_strip_support_more_bytes_orders branch 2 times, most recently from 0f5696b to 3c33ebf Compare August 20, 2024 04:00
@Kainarx
Copy link
Contributor Author

Kainarx commented Aug 20, 2024

After all that, you silently withdraw the PR?

I get that it's been open for a month while being ignored by the maintainers, but IMO this is work worth picking up and if you're just exhausted trying to get it in, I may run with it (adding a second white channel) but based on my recent experience trying to change IDF, I'm not at all sure that I wouldn't just rather fork it and maintain it myself and bypass the reviewer clique.

Why was this dropped?

Sorry, I didn't really mean to close it, it was a mistake on my part. I've re-pushed it. Thank you for your attention.

led_strip/api.md Outdated Show resolved Hide resolved
led_strip/api.md Outdated Show resolved Hide resolved
led_strip/include/led_strip_types.h Outdated Show resolved Hide resolved
led_strip/src/led_strip_rmt_dev.c Outdated Show resolved Hide resolved
@Kainarx Kainarx force-pushed the feat/led_strip_support_more_bytes_orders branch 2 times, most recently from ad5231d to aa2630c Compare October 22, 2024 05:20
led_strip/CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@suda-morris suda-morris left a comment

Choose a reason for hiding this comment

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

Thanks for giving this approach a try, LGTM overall. @Kainarx

@Kainarx Kainarx force-pushed the feat/led_strip_support_more_bytes_orders branch 3 times, most recently from 54ae110 to 0680770 Compare October 23, 2024 05:21
@suda-morris suda-morris force-pushed the feat/led_strip_support_more_bytes_orders branch 5 times, most recently from 1ab7622 to 0501326 Compare October 24, 2024 08:03
@suda-morris suda-morris requested a review from igrr October 24, 2024 09:58
@suda-morris suda-morris force-pushed the feat/led_strip_support_more_bytes_orders branch 2 times, most recently from 5314606 to 1539f0d Compare October 25, 2024 09:35
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

clang-tidy found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@suda-morris suda-morris force-pushed the feat/led_strip_support_more_bytes_orders branch from 1539f0d to 31585c8 Compare October 25, 2024 10:07
__led_strip_spi_bit(0, &spi_strip->pixel_buf[start + SPI_BYTES_PER_COLOR_BYTE * 3]);
uint8_t *pixel_buf = spi_strip->pixel_buf;
led_color_component_format_t component_fmt = spi_strip->component_fmt;
memset(pixel_buf + start, 0, spi_strip->bytes_per_pixel * SPI_BYTES_PER_COLOR_BYTE);

Check warning

Code scanning / clang-tidy

Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning

Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
__led_strip_spi_bit(blue, &spi_strip->pixel_buf[start + SPI_BYTES_PER_COLOR_BYTE * 2]);
__led_strip_spi_bit(white, &spi_strip->pixel_buf[start + SPI_BYTES_PER_COLOR_BYTE * 3]);
uint8_t *pixel_buf = spi_strip->pixel_buf;
memset(pixel_buf + start, 0, spi_strip->bytes_per_pixel * SPI_BYTES_PER_COLOR_BYTE);

Check warning

Code scanning / clang-tidy

Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning

Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
@suda-morris suda-morris merged commit 4769e0a into espressif:master Oct 25, 2024
48 checks passed
@Kainarx Kainarx deleted the feat/led_strip_support_more_bytes_orders branch October 30, 2024 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[led_strip] Add support for bytes order other than GRB (IEC-123)
5 participants