From 9be1de54ae11b20cc3f47008080bc4afb80369c5 Mon Sep 17 00:00:00 2001 From: GHGiampy <83699429+GHGiampy@users.noreply.github.com> Date: Sat, 16 Jul 2022 03:14:15 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Add'l=20ProUI=20fixes=20(#24500)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/proui/dwin.cpp | 13 +++++-------- Marlin/src/lcd/e3v2/proui/dwin_defines.h | 4 +++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 762a4fb627..111af5acd7 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -1825,7 +1825,7 @@ void DWIN_SetDataDefaults() { #endif TERN_(BAUD_RATE_GCODE, SetBaud250K()); #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) - leds.set_default(); + TERN_(LED_COLOR_PRESETS, leds.set_default()); ApplyLEDColor(); #endif } @@ -2226,10 +2226,9 @@ void SetPID(celsius_t t, heater_id_t h) { #endif #if ENABLED(BAUD_RATE_GCODE) - void HMI_SetBaudRate() { - if (HMI_data.Baud115K) SetBaud115K(); else SetBaud250K(); - } + void HMI_SetBaudRate() { HMI_data.Baud115K ? SetBaud115K() : SetBaud250K(); } void SetBaudRate() { + HMI_data.Baud115K ^= true; HMI_SetBaudRate(); Draw_Chkb_Line(CurrentMenu->line(), HMI_data.Baud115K); DWIN_UpdateLCD(); @@ -2268,9 +2267,7 @@ void SetPID(celsius_t t, heater_id_t h) { #endif #if HAS_COLOR_LEDS 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 }) - ); + HMI_data.Led_Color = LEDColor( {leds.color.r, leds.color.g, leds.color.b OPTARG(HAS_WHITE_LED, HMI_data.Led_Color.w) } ); } void LiveLEDColor(uint8_t *color) { *color = MenuData.Value; leds.update(); } void LiveLEDColorR() { LiveLEDColor(&leds.color.r); } @@ -3415,7 +3412,7 @@ void Draw_GetColor_Menu() { EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_GREEN, onDrawPInt8Menu, SetLEDColorG, &leds.color.g); EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_BLUE, onDrawPInt8Menu, SetLEDColorB, &leds.color.b); #if ENABLED(HAS_WHITE_LED) - EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_WHITE, onDrawPInt8Menu, SetLedColorW, &leds.color.w); + EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_WHITE, onDrawPInt8Menu, SetLEDColorW, &leds.color.w); #endif #endif #endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h index 98aadb8e73..dffc26478d 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -37,13 +37,15 @@ #include "../../../inc/MarlinConfigPre.h" #include "../common/dwin_color.h" +#if ENABLED(LED_CONTROL_MENU) + #include "../../../feature/leds/leds.h" +#endif #include #if defined(__STM32F1__) || defined(STM32F1) #define DASH_REDRAW 1 #endif - #define Def_Background_Color RGB( 1, 12, 8) #define Def_Cursor_color RGB(20, 49, 31) #define Def_TitleBg_color RGB( 0, 23, 16)