From e7a48497e750fe9b0c824ff8a9989c228114ba14 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 24 Jan 2019 14:21:47 +0100 Subject: [PATCH] Chase: Use CRGB when setting colors When not using the `CRGB()` macro, colors may end up being different than intended if the board we're running on implements RGB order differently. Fixes #548. Signed-off-by: Gergely Nagy --- src/kaleidoscope/plugin/LEDEffect-Chase.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kaleidoscope/plugin/LEDEffect-Chase.cpp b/src/kaleidoscope/plugin/LEDEffect-Chase.cpp index 7a1088ce..5a80cf56 100644 --- a/src/kaleidoscope/plugin/LEDEffect-Chase.cpp +++ b/src/kaleidoscope/plugin/LEDEffect-Chase.cpp @@ -37,9 +37,9 @@ void LEDChaseEffect::update(void) { // the first few updates, `pos2` will be out of bounds. Since it's an unsigned integer, // even when it would have a value below zero, it underflows and so one test is good for // both ends of the range. - ::LEDControl.setCrgbAt(pos, {0, 0, 0}); + ::LEDControl.setCrgbAt(pos, CRGB(0, 0, 0)); if (pos2 < LED_COUNT) - ::LEDControl.setCrgbAt(pos2, {0, 0, 0}); + ::LEDControl.setCrgbAt(pos2, CRGB(0, 0, 0)); // Next, we adjust the red light's position. If the direction hasn't changed (the red // light isn't out of bounds), we also adjust the blue light's position to match the red @@ -58,9 +58,9 @@ void LEDChaseEffect::update(void) { // Last, we turn on the LEDs at their new positions. As before, the blue light (pos2) is // only set if it's in the valid LED range. - ::LEDControl.setCrgbAt(pos, {0, 0, 255}); + ::LEDControl.setCrgbAt(pos, CRGB(255, 0, 0)); if (pos2 < LED_COUNT) - ::LEDControl.setCrgbAt(pos2, {255, 0, 0}); + ::LEDControl.setCrgbAt(pos2, CRGB(0, 0, 255)); } }