Menu items for Separate NeoPixel (#19280)
This commit is contained in:
committed by
Scott Lahteine
parent
83dba77955
commit
a8db9f52ec
@ -183,7 +183,17 @@ void LEDLights::set_color(const LEDColor &incol
|
||||
: neo2.Color(incol.r, incol.g, incol.b, incol.w);
|
||||
neo2.set_brightness(incol.i);
|
||||
neo2.set_color(neocolor);
|
||||
|
||||
#if ENABLED(LED_CONTROL_MENU)
|
||||
// Don't update the color when OFF
|
||||
lights_on = !incol.is_off();
|
||||
if (lights_on) color = incol;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ENABLED(LED_CONTROL_MENU)
|
||||
void LEDLights2::toggle() { if (lights_on) set_off(); else update(); }
|
||||
#endif
|
||||
|
||||
#endif // NEOPIXEL2_SEPARATE
|
||||
|
||||
|
@ -240,7 +240,7 @@ extern LEDLights leds;
|
||||
static inline void set_violet() { set_color(LEDColorViolet()); }
|
||||
#endif
|
||||
|
||||
#if ENABLED(LED_CONTROL_MENU)
|
||||
#if ENABLED(NEOPIXEL2_SEPARATE)
|
||||
static LEDColor color; // last non-off color
|
||||
static bool lights_on; // the last set color was "on"
|
||||
static void toggle(); // swap "off" with color
|
||||
|
Reference in New Issue
Block a user