🩹 Fix ProUI LED compile (#24473)

This commit is contained in:
GHGiampy 2022-07-14 07:03:27 +02:00 committed by Scott Lahteine
parent 3c9789fda8
commit 4a6ad1c98b
2 changed files with 12 additions and 11 deletions

View File

@ -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); }

View File

@ -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;