Use NEOPIXEL as case light

Add an option to use the NEOPIXEL LED as case light.
This commit is contained in:
nhchiu
2018-01-16 12:53:18 +08:00
committed by Scott Lahteine
parent 428fbe8228
commit 4a40cf268d
5 changed files with 54 additions and 13 deletions

View File

@@ -70,6 +70,21 @@ typedef struct LEDColor {
#endif
#endif
{}
LEDColor(const uint8_t (&rgbw)[4]) : r(rgbw[0]), g(rgbw[1]), b(rgbw[2])
#if HAS_WHITE_LED
, w(rgbw[3])
#if ENABLED(NEOPIXEL_LED)
, i(NEOPIXEL_BRIGHTNESS)
#endif
#endif
{}
LEDColor& operator=(const uint8_t (&rgbw)[4]) {
r = rgbw[0]; g = rgbw[1]; b = rgbw[2];
#if HAS_WHITE_LED
w = rgbw[3];
#endif
return *this;
}
LEDColor& operator=(const LEDColor &right) {
if (this != &right) memcpy(this, &right, sizeof(LEDColor));
return *this;