Menu items for Separate NeoPixel (#19280)
This commit is contained in:
1 parent
f29baed540
commit
5ea7a8373a
5 files changed
+67
-11
No files matched your search
@@ -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