Skip to content

Commit 2814861

Browse files
authored
fix(rgbled): it lacks GRB case
Made GRB default + switch/case exceptions.
1 parent f489e16 commit 2814861

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Diff for: cores/esp32/esp32-hal-rgb-led.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ void neopixelWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue
2929
return;
3030
}
3131

32+
// default WS2812B color order is G, R, B
33+
const int color[3] = {green_val, red_val, blue_val};
34+
3235
#if defined RGB_BUILTIN_LED_COLOR_ORDER
3336
// the onboard RGB LED has a different color order
34-
const int color[3];
3537
switch (RGB_BUILTIN_LED_COLOR_ORDER) {
3638
case LED_COLOR_ORDER_RGB:
3739
color[0] = red_val;
@@ -58,9 +60,6 @@ void neopixelWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue
5860
color[1] = blue_val;
5961
color[2] = red_val;
6062
}
61-
#else
62-
// default WS2812B color order is G, R, B
63-
const int color[3] = {green_val, red_val, blue_val};
6463
#endif
6564

6665
int i = 0;

0 commit comments

Comments
 (0)