Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MarlinFirmware/Marlin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Lahteine <thinkyhead@users.noreply.github.com>2022-11-05 04:00:56 +0300
committerScott Lahteine <thinkyhead@users.noreply.github.com>2022-11-05 04:11:18 +0300
commita80d2f065e31248a10d3c8b1c4d4492f6b6196fc (patch)
treec23975b96ee65465990fdf644845a3b04b913494
parent32fa577d256eac7bbd8f53c857eaed123d6bf9dd (diff)
🩹 leds.update needed for reset_timeout
Followup to #23590
-rw-r--r--Marlin/src/feature/leds/leds.h14
-rwxr-xr-xbuildroot/tests/rambo2
2 files changed, 9 insertions, 7 deletions
diff --git a/Marlin/src/feature/leds/leds.h b/Marlin/src/feature/leds/leds.h
index 8649dd014f..572fd0dfac 100644
--- a/Marlin/src/feature/leds/leds.h
+++ b/Marlin/src/feature/leds/leds.h
@@ -107,6 +107,13 @@ typedef struct LEDColor {
class LEDLights {
public:
+ #if ANY(LED_CONTROL_MENU, PRINTER_EVENT_LEDS, CASE_LIGHT_IS_COLOR_LED)
+ static LEDColor color; // last non-off color
+ static bool lights_on; // the last set color was "on"
+ #else
+ static constexpr bool lights_on = true;
+ #endif
+
LEDLights() {} // ctor
static void setup(); // init()
@@ -142,15 +149,10 @@ public:
static LEDColor get_color() { return lights_on ? color : LEDColorOff(); }
#endif
- #if ANY(LED_CONTROL_MENU, PRINTER_EVENT_LEDS, CASE_LIGHT_IS_COLOR_LED)
- static LEDColor color; // last non-off color
- static bool lights_on; // the last set color was "on"
- #endif
-
#if ENABLED(LED_CONTROL_MENU)
static void toggle(); // swap "off" with color
#endif
- #if EITHER(LED_CONTROL_MENU, CASE_LIGHT_USE_RGB_LED)
+ #if EITHER(LED_CONTROL_MENU, CASE_LIGHT_USE_RGB_LED) || LED_POWEROFF_TIMEOUT > 0
static void update() { set_color(color); }
#endif
diff --git a/buildroot/tests/rambo b/buildroot/tests/rambo
index de6cdc7129..9a017c971f 100755
--- a/buildroot/tests/rambo
+++ b/buildroot/tests/rambo
@@ -32,7 +32,7 @@ opt_enable USE_ZMAX_PLUG REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_P
SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE \
BACKLASH_COMPENSATION BACKLASH_GCODE BAUD_RATE_GCODE BEZIER_CURVE_SUPPORT \
FWRETRACT ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \
- PSU_CONTROL PS_OFF_CONFIRM PS_OFF_SOUND POWER_OFF_WAIT_FOR_COOLDOWN \
+ PSU_CONTROL LED_POWEROFF_TIMEOUT PS_OFF_CONFIRM PS_OFF_SOUND POWER_OFF_WAIT_FOR_COOLDOWN \
POWER_LOSS_RECOVERY POWER_LOSS_PIN POWER_LOSS_STATE POWER_LOSS_RECOVER_ZHOME POWER_LOSS_ZHOME_POS \
SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER LIN_ADVANCE ADVANCE_K_EXTRA \
HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL