mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-27 16:54:15 +01:00
OP-1312 Fixed led boundary check and framebuffer color order.
This commit is contained in:
parent
99f19dd809
commit
58178ab193
@ -223,11 +223,11 @@ void setColor(uint8_t color, ledbuf_t *buf)
|
|||||||
*/
|
*/
|
||||||
void PIOS_WS2811_setColorRGB(Color c, uint8_t led, bool update)
|
void PIOS_WS2811_setColorRGB(Color c, uint8_t led, bool update)
|
||||||
{
|
{
|
||||||
if (led > PIOS_WS2811_NUMLEDS) {
|
if (led >= PIOS_WS2811_NUMLEDS) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setColor(c.R, fb + (led * 24));
|
setColor(c.G, fb + (led * 24));
|
||||||
setColor(c.G, fb + 8 + (led * 24));
|
setColor(c.R, fb + 8 + (led * 24));
|
||||||
setColor(c.B, fb + 16 + (led * 24));
|
setColor(c.B, fb + 16 + (led * 24));
|
||||||
if (update) {
|
if (update) {
|
||||||
PIOS_WS2811_Update();
|
PIOS_WS2811_Update();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user