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:
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)
|
||||
{
|
||||
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();
|
||||
|
Loading…
Reference in New Issue
Block a user