Browse Source

🩹 leds.update needed for reset_timeout

Followup to #23590
Scott Lahteine 2 years ago
parent
commit
a80d2f065e
2 changed files with 9 additions and 7 deletions
  1. 8
    6
      Marlin/src/feature/leds/leds.h
  2. 1
    1
      buildroot/tests/rambo

+ 8
- 6
Marlin/src/feature/leds/leds.h View File

107
 
107
 
108
 class LEDLights {
108
 class LEDLights {
109
 public:
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
   LEDLights() {} // ctor
117
   LEDLights() {} // ctor
111
 
118
 
112
   static void setup(); // init()
119
   static void setup(); // init()
142
     static LEDColor get_color() { return lights_on ? color : LEDColorOff(); }
149
     static LEDColor get_color() { return lights_on ? color : LEDColorOff(); }
143
   #endif
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
   #if ENABLED(LED_CONTROL_MENU)
152
   #if ENABLED(LED_CONTROL_MENU)
151
     static void toggle();  // swap "off" with color
153
     static void toggle();  // swap "off" with color
152
   #endif
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
     static void update() { set_color(color); }
156
     static void update() { set_color(color); }
155
   #endif
157
   #endif
156
 
158
 

+ 1
- 1
buildroot/tests/rambo View File

32
            SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE \
32
            SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE \
33
            BACKLASH_COMPENSATION BACKLASH_GCODE BAUD_RATE_GCODE BEZIER_CURVE_SUPPORT \
33
            BACKLASH_COMPENSATION BACKLASH_GCODE BAUD_RATE_GCODE BEZIER_CURVE_SUPPORT \
34
            FWRETRACT ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \
34
            FWRETRACT ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \
35
-           PSU_CONTROL PS_OFF_CONFIRM PS_OFF_SOUND POWER_OFF_WAIT_FOR_COOLDOWN \
35
+           PSU_CONTROL LED_POWEROFF_TIMEOUT PS_OFF_CONFIRM PS_OFF_SOUND POWER_OFF_WAIT_FOR_COOLDOWN \
36
            POWER_LOSS_RECOVERY POWER_LOSS_PIN POWER_LOSS_STATE POWER_LOSS_RECOVER_ZHOME POWER_LOSS_ZHOME_POS \
36
            POWER_LOSS_RECOVERY POWER_LOSS_PIN POWER_LOSS_STATE POWER_LOSS_RECOVER_ZHOME POWER_LOSS_ZHOME_POS \
37
            SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER LIN_ADVANCE ADVANCE_K_EXTRA \
37
            SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER LIN_ADVANCE ADVANCE_K_EXTRA \
38
            HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL
38
            HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL

Loading…
Cancel
Save