Skip to content

Commit 8e34e61

Browse files
pelwellpopcornmix
authored andcommitted
misc: ws2812-pio-rp1: Add pass-through mode
Pass-through mode disables all gamma and brightness processing, sending the raw pixel data directly to the LEDs. It is enabled by setting the brightness to zero, either in Device Tree or using the runtime method of writing a single byte (in this case 0) to the device. See: #7108 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
1 parent 85d67e5 commit 8e34e61

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)