-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
bugfixed in sourceThis issue is unsolved in the latest release but fixed in masterThis issue is unsolved in the latest release but fixed in master
Description
This line is a bit suspicious, and I doubt it will work as intended (from #3193)
https://github.com/Aircoookie/WLED/blob/999bec19f1bf37b344177a9aeffc752c5f4ae472/wled00/e131.cpp#L28
Compiler warning:
wled00/e131.cpp:29:57: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
uint8_t ddpChannelsPerLed = (p->dataType & 0b00111000 == 0b011) ? 4 : 3; // data type 0x1B (formerly 0x1A) is RGBW (type 3, 8 bit/channel)
~~~~~~~~~~~^~~~~~~~
If it is intended as ((p->dataType & 0b00111000) == 0b011), then the decision cannot become true. Any value & 0b00111000 will not have the lowest 3 bits sets, as they are masked out by "&".
Actually I'm not sure how it was indented to work, maybe the original author could take a look?
Metadata
Metadata
Assignees
Labels
bugfixed in sourceThis issue is unsolved in the latest release but fixed in masterThis issue is unsolved in the latest release but fixed in master