[2.0.x] Option to use Neopixel as case light (#9270)

* Add option to use Neopixel as case light

* Apply CASE_LIGHT_USE_NEOPIXEL to example configs
This commit is contained in:
Scott Lahteine
2018-01-20 16:58:41 -06:00
committed by GitHub
parent 9b519864bf
commit 8190fdb260
46 changed files with 218 additions and 17 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;