Browse Source

🎨 Add DWIN_StatusChanged_P

vanilla_fb_2.0.x
Scott Lahteine 3 years ago
committed by Scott Lahteine
parent
commit
e71fa2b649
  1. 2
      Marlin/src/MarlinCore.cpp
  2. 6
      Marlin/src/lcd/dwin/e3v2/dwin.cpp
  3. 1
      Marlin/src/lcd/dwin/e3v2/dwin.h

2
Marlin/src/MarlinCore.cpp

@ -1593,7 +1593,7 @@ void setup() {
HMI_Init(); HMI_Init();
DWIN_JPG_CacheTo1(Language_English); DWIN_JPG_CacheTo1(Language_English);
HMI_StartFrame(true); HMI_StartFrame(true);
DWIN_StatusChanged(GET_TEXT(WELCOME_MSG)); DWIN_StatusChanged_P(GET_TEXT(WELCOME_MSG));
#endif #endif
#if HAS_SERVICE_INTERVALS && DISABLED(DWIN_CREALITY_LCD) #if HAS_SERVICE_INTERVALS && DISABLED(DWIN_CREALITY_LCD)

6
Marlin/src/lcd/dwin/e3v2/dwin.cpp

@ -4128,6 +4128,12 @@ void DWIN_StatusChanged(const char *text) {
DWIN_UpdateLCD(); DWIN_UpdateLCD();
} }
void DWIN_StatusChanged_P(PGM_P const pstr) {
char str[strlen_P((const char*)pstr) + 1];
strcpy_P(str, (const char*)pstr);
DWIN_StatusChanged(str);
}
// GUI extension // GUI extension
void DWIN_Draw_Checkbox(uint16_t color, uint16_t bcolor, uint16_t x, uint16_t y, bool mode=false) { void DWIN_Draw_Checkbox(uint16_t color, uint16_t bcolor, uint16_t x, uint16_t y, bool mode=false) {
DWIN_Draw_String(false,true,font8x16,Select_Color,bcolor,x+4,y,F(mode ? "x" : " ")); DWIN_Draw_String(false,true,font8x16,Select_Color,bcolor,x+4,y,F(mode ? "x" : " "));

1
Marlin/src/lcd/dwin/e3v2/dwin.h

@ -404,6 +404,7 @@ void DWIN_Update();
void EachMomentUpdate(); void EachMomentUpdate();
void DWIN_HandleScreen(); void DWIN_HandleScreen();
void DWIN_StatusChanged(const char *text); void DWIN_StatusChanged(const char *text);
void DWIN_StatusChanged_P(PGM_P const pstr);
void DWIN_Draw_Checkbox(uint16_t color, uint16_t bcolor, uint16_t x, uint16_t y, bool mode /* = false*/); void DWIN_Draw_Checkbox(uint16_t color, uint16_t bcolor, uint16_t x, uint16_t y, bool mode /* = false*/);
inline void DWIN_StartHoming() { HMI_flag.home_flag = true; } inline void DWIN_StartHoming() { HMI_flag.home_flag = true; }

Loading…
Cancel
Save