Skip to content

Commit b59cb73

Browse files
committed
misc: ws2812-pio-rp1: Allow gamma to be disabled
Modify the gamma logic such that setting the brightness in DT to zero causes the supplied pixel values to be passed through unmodified. See: #7108 Signed-off-by: Phil Elwell <[email protected]>
1 parent 2e376fd commit b59cb73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/misc/ws2812-pio-rp1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ static uint8_t ws2812_apply_gamma(uint8_t brightness, uint8_t val)
142142
{
143143
int bright;
144144

145-
if (!val)
146-
return 0;
145+
if (!val || !brightness)
146+
return val;
147147
bright = (val * brightness) / 255;
148148
return ws2812_gamma[bright];
149149
}

0 commit comments

Comments
 (0)