Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E3V2 ProUI: Fix LED compile errors #24473

Merged
merged 3 commits into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions Marlin/src/lcd/e3v2/proui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1843,17 +1843,12 @@ void DWIN_CopySettingsFrom(const char * const buff) {
TERN_(PREVENT_COLD_EXTRUSION, ApplyExtMinT());
feedrate_percentage = 100;
TERN_(BAUD_RATE_GCODE, HMI_SetBaudRate());
#if BOTH(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS)
// Apply Case light brightness
caselight.brightness = HMI_data.CaseLight_Brightness;
caselight.update_brightness();
#endif
#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
Expand Down Expand Up @@ -2264,7 +2259,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); }
Expand Down
9 changes: 3 additions & 6 deletions Marlin/src/lcd/e3v2/proui/dwin_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@
#define HAS_ESDIAG 1

#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 {
Expand Down Expand Up @@ -115,12 +112,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;

Expand Down