Clean it up

This commit is contained in:
Daniel Løvbrøtte Olsen 2017-01-03 09:30:34 +01:00 committed by GitHub
parent 0ea01d6d25
commit a31115d4ff

View File

@ -55,24 +55,32 @@ bool updateColor(LEDSelect selection, CRGB color, CRGB* leds) {
if (selection.side == 255) { if (selection.side == 255) {
return false; return false;
} }
if (selection.column == 255 && selection.row == 255) { if (selection.column == 255 && selection.row == 255) {
for (int n = 0; n < 9; n++) { for (int n = 0; n < 9; n++) {
CRGB* led = &leds[selection.side * 9 + n]; CRGB* led = &leds[selection.side * 9 + n];
if (*led != (CRGB)0x000000)*led = color; if (*led != (CRGB) 0x000000) {
*led = color;
}
} }
return true; return true;
} }
else if (selection.column == 255 && selection.row != 255) { else if (selection.column == 255 && selection.row != 255) {
for (int n = 0; n < 3; n++) { for (int n = 0; n < 3; n++) {
CRGB* led = &leds[decodeLED({ selection.side, n, selection.row })]; CRGB* led = &leds[decodeLED({ selection.side, n, selection.row })];
if (*led != (CRGB)0x000000)*led = color; if (*led != (CRGB)0x000000) {
*led = color;
}
} }
return true; return true;
} }
else if (selection.column != 255 && selection.row == 255) { else if (selection.column != 255 && selection.row == 255) {
for (int n = 0; n < 3; n++) { for (int n = 0; n < 3; n++) {
CRGB* led = &leds[decodeLED({ selection.side, selection.column, n })]; CRGB* led = &leds[decodeLED({ selection.side, selection.column, n })];
if (*led != (CRGB)0x000000)*led = color; if (*led != (CRGB) 0x000000) {
*led = color;
}
} }
return true; return true;
} }