Skip to content

Commit

Permalink
Correcting designator order in main.c
Browse files Browse the repository at this point in the history
The designator order in main.c does not match the one defined in ws2811.h. 
This leads to problems when using the code with c++ compilers. 
* clang 13.0.0-2 emits warnings and corrects the initializations
* GCC 11.2.0 and 10.2.1 will emit an error (see issue #429)

I corrected the initialization order here and the compilation now works with the afromentioned complainers without issues. 
Tested on Ubuntu 21.10 (clang 13.0.0-2/gcc 11.2.0) and Raspberry Pi 4 Release 11 bullseye (GCC 10.2.1)
  • Loading branch information
Deadolus authored May 3, 2022
1 parent 9be313f commit 920bb74
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ ws2811_t ledstring =
[0] =
{
.gpionum = GPIO_PIN,
.count = LED_COUNT,
.invert = 0,
.brightness = 255,
.count = LED_COUNT,
.strip_type = STRIP_TYPE,
.brightness = 255,
},
[1] =
{
.gpionum = 0,
.count = 0,
.invert = 0,
.count = 0,
.brightness = 0,
},
},
Expand Down

0 comments on commit 920bb74

Please # to comment.