From a31115d4ff6cc69203e54ed89bdfc4e234304737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B8vbr=C3=B8tte=20Olsen?= Date: Tue, 3 Jan 2017 09:30:34 +0100 Subject: [PATCH] Clean it up --- School/vg2/borg/borg.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/School/vg2/borg/borg.h b/School/vg2/borg/borg.h index e40893a..b24ce9c 100644 --- a/School/vg2/borg/borg.h +++ b/School/vg2/borg/borg.h @@ -55,30 +55,38 @@ bool updateColor(LEDSelect selection, CRGB color, CRGB* leds) { if (selection.side == 255) { return false; } + + if (selection.column == 255 && selection.row == 255) { for (int n = 0; n < 9; n++) { CRGB* led = &leds[selection.side * 9 + n]; - if (*led != (CRGB)0x000000)*led = color; + if (*led != (CRGB) 0x000000) { + *led = color; + } } return true; } else if (selection.column == 255 && selection.row != 255) { for (int n = 0; n < 3; n++) { CRGB* led = &leds[decodeLED({ selection.side, n, selection.row })]; - if (*led != (CRGB)0x000000)*led = color; + if (*led != (CRGB)0x000000) { + *led = color; + } } return true; } else if (selection.column != 255 && selection.row == 255) { for (int n = 0; n < 3; n++) { CRGB* led = &leds[decodeLED({ selection.side, selection.column, n })]; - if (*led != (CRGB)0x000000)*led = color; + if (*led != (CRGB) 0x000000) { + *led = color; + } } return true; } else if (selection.column != 255 && selection.row != 255) { CRGB* led = &leds[decodeLED(selection)]; - if (*led != (CRGB)0x000000) { + if (*led != (CRGB) 0x000000) { *led = color; } return true;