You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
suspicious code in e131.cpp (detect RGB / RGBW) #3236
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?
Activity
blazoncek commentedon Jun 7, 2023
It has been fixed in
beta-3branch.Aircoookie commentedon Jun 7, 2023
Embarrassing 😅 Well, mistakes happen, thanks for catching it @softhack007 and fixing it promptly @blazoncek :)