Apply TERN to compact code (#17619)

This commit is contained in:
Scott Lahteine
2020-04-22 16:35:03 -05:00
committed by GitHub
parent 88bdd26c99
commit 6d90d1e1f5
162 changed files with 1493 additions and 3530 deletions

View File

@@ -34,7 +34,9 @@
#endif
// A white component can be passed
#define HAS_WHITE_LED EITHER(RGBW_LED, NEOPIXEL_LED)
#if EITHER(RGBW_LED, NEOPIXEL_LED)
#define HAS_WHITE_LED 1
#endif
/**
* LEDcolor type for use with leds.set_color
@@ -85,9 +87,7 @@ typedef struct LEDColor {
LEDColor& operator=(const uint8_t (&rgbw)[4]) {
r = rgbw[0]; g = rgbw[1]; b = rgbw[2];
#if HAS_WHITE_LED
w = rgbw[3];
#endif
TERN_(HAS_WHITE_LED, w = rgbw[3]);
return *this;
}