1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

OP-1312 Fixed led boundary check and framebuffer color order.

This commit is contained in:
Alessio Morale 2014-04-27 19:11:28 +02:00
parent 99f19dd809
commit 58178ab193

View File

@ -223,11 +223,11 @@ void setColor(uint8_t color, ledbuf_t *buf)
*/
void PIOS_WS2811_setColorRGB(Color c, uint8_t led, bool update)
{
if (led > PIOS_WS2811_NUMLEDS) {
if (led >= PIOS_WS2811_NUMLEDS) {
return;
}
setColor(c.R, fb + (led * 24));
setColor(c.G, fb + 8 + (led * 24));
setColor(c.G, fb + (led * 24));
setColor(c.R, fb + 8 + (led * 24));
setColor(c.B, fb + 16 + (led * 24));
if (update) {
PIOS_WS2811_Update();