From 4a6ad1c98bde764255511c5bce58740b6e5cfb13 Mon Sep 17 00:00:00 2001 From: GHGiampy <83699429+GHGiampy@users.noreply.github.com> Date: Thu, 14 Jul 2022 07:03:27 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20ProUI=20LED=20compile=20(#?= =?UTF-8?q?24473)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/proui/dwin.cpp | 14 +++++++++----- Marlin/src/lcd/e3v2/proui/dwin_defines.h | 9 +++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 27e1003ab6..762a4fb627 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -1843,10 +1843,10 @@ void DWIN_CopySettingsFrom(const char * const buff) { TERN_(BAUD_RATE_GCODE, HMI_SetBaudRate()); #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) leds.set_color( - (HMI_data.LED_Color >> 16) & 0xFF, - (HMI_data.LED_Color >> 8) & 0xFF, - (HMI_data.LED_Color >> 0) & 0xFF - OPTARG(HAS_WHITE_LED, (HMI_data.LED_Color >> 24) & 0xFF) + HMI_data.Led_Color.r, + HMI_data.Led_Color.g, + HMI_data.Led_Color.b + OPTARG(HAS_WHITE_LED, HMI_data.Led_Color.w) ); leds.update(); #endif @@ -2267,7 +2267,11 @@ void SetPID(celsius_t t, heater_id_t h) { } #endif #if HAS_COLOR_LEDS - void ApplyLEDColor() { HMI_data.LED_Color = TERN0(HAS_WHITE_LED, (leds.color.w << 24)) | (leds.color.r << 16) | (leds.color.g << 8) | leds.color.b; } + void ApplyLEDColor() { + HMI_data.Led_Color = LEDColor( + TERN(HAS_WHITE_LED, { 0, 0, 0, leds.color.w }, { leds.color.r, leds.color.g, leds.color.b }) + ); + } void LiveLEDColor(uint8_t *color) { *color = MenuData.Value; leds.update(); } void LiveLEDColorR() { LiveLEDColor(&leds.color.r); } void LiveLEDColorG() { LiveLEDColor(&leds.color.g); } diff --git a/Marlin/src/lcd/e3v2/proui/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h index 0c4e0104f4..98aadb8e73 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -64,10 +64,7 @@ #define Def_Coordinate_Color Color_White #define Def_Button_Color RGB( 0, 23, 16) #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) - #define Def_Leds_Color 0xFFFFFFFF -#endif -#if ENABLED(CASELIGHT_USES_BRIGHTNESS) - #define Def_CaseLight_Brightness 255 + #define Def_Leds_Color LEDColorWhite() #endif typedef struct { @@ -110,12 +107,12 @@ typedef struct { bool Baud115K = false; #endif bool FullManualTramming = false; - // Led #if ENABLED(MESH_BED_LEVELING) float ManualZOffset = 0; #endif + // Led #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) - uint32_t LED_Color = Def_Leds_Color; + LEDColor Led_Color = Def_Leds_Color; #endif } HMI_data_t;