|
@@ -107,6 +107,13 @@ typedef struct LEDColor {
|
107
|
107
|
|
108
|
108
|
class LEDLights {
|
109
|
109
|
public:
|
|
110
|
+ #if ANY(LED_CONTROL_MENU, PRINTER_EVENT_LEDS, CASE_LIGHT_IS_COLOR_LED)
|
|
111
|
+ static LEDColor color; // last non-off color
|
|
112
|
+ static bool lights_on; // the last set color was "on"
|
|
113
|
+ #else
|
|
114
|
+ static constexpr bool lights_on = true;
|
|
115
|
+ #endif
|
|
116
|
+
|
110
|
117
|
LEDLights() {} // ctor
|
111
|
118
|
|
112
|
119
|
static void setup(); // init()
|
|
@@ -142,15 +149,10 @@ public:
|
142
|
149
|
static LEDColor get_color() { return lights_on ? color : LEDColorOff(); }
|
143
|
150
|
#endif
|
144
|
151
|
|
145
|
|
- #if ANY(LED_CONTROL_MENU, PRINTER_EVENT_LEDS, CASE_LIGHT_IS_COLOR_LED)
|
146
|
|
- static LEDColor color; // last non-off color
|
147
|
|
- static bool lights_on; // the last set color was "on"
|
148
|
|
- #endif
|
149
|
|
-
|
150
|
152
|
#if ENABLED(LED_CONTROL_MENU)
|
151
|
153
|
static void toggle(); // swap "off" with color
|
152
|
154
|
#endif
|
153
|
|
- #if EITHER(LED_CONTROL_MENU, CASE_LIGHT_USE_RGB_LED)
|
|
155
|
+ #if EITHER(LED_CONTROL_MENU, CASE_LIGHT_USE_RGB_LED) || LED_POWEROFF_TIMEOUT > 0
|
154
|
156
|
static void update() { set_color(color); }
|
155
|
157
|
#endif
|
156
|
158
|
|