Skip to content

Commit

Permalink
🩹 Fix ProUI LED compile (MarlinFirmware#24473)
Browse files Browse the repository at this point in the history
  • Loading branch information
GHGiampy authored and imp67 committed Sep 4, 2022
1 parent 03c081e commit fcfab70
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
14 changes: 9 additions & 5 deletions Marlin/src/lcd/e3v2/proui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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); }
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 @@ -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 {
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit fcfab70

Please sign in to comment.