Преглед на файлове

🩹 leds.update needed for reset_timeout

Followup to #23590
Scott Lahteine преди 2 години
родител
ревизия
a80d2f065e
променени са 2 файла, в които са добавени 9 реда и са изтрити 7 реда
  1. 8
    6
      Marlin/src/feature/leds/leds.h
  2. 1
    1
      buildroot/tests/rambo

+ 8
- 6
Marlin/src/feature/leds/leds.h Целия файл

@@ -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
 

+ 1
- 1
buildroot/tests/rambo Целия файл

@@ -32,7 +32,7 @@ opt_enable USE_ZMAX_PLUG REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_P
32 32
            SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE \
33 33
            BACKLASH_COMPENSATION BACKLASH_GCODE BAUD_RATE_GCODE BEZIER_CURVE_SUPPORT \
34 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 36
            POWER_LOSS_RECOVERY POWER_LOSS_PIN POWER_LOSS_STATE POWER_LOSS_RECOVER_ZHOME POWER_LOSS_ZHOME_POS \
37 37
            SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER LIN_ADVANCE ADVANCE_K_EXTRA \
38 38
            HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL

Loading…
Отказ
Запис