mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-28 05:06:32 +00:00
Unify display/touch init messages
This commit is contained in:
parent
8f6a0b15c3
commit
e9fdbea091
@ -242,7 +242,7 @@ void utouch_Touch_Init() {
|
|||||||
char *name;
|
char *name;
|
||||||
utouch_found = renderer->utouch_Init(&name);
|
utouch_found = renderer->utouch_Init(&name);
|
||||||
if (utouch_found) {
|
if (utouch_found) {
|
||||||
AddLog(LOG_LEVEL_INFO, PSTR("UT : %s"), name);
|
AddLog(LOG_LEVEL_INFO, PSTR("UTI: %s initialized"), name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,22 +69,18 @@ const char DSP_SAMPLE_DESC[] PROGMEM = DSP_ROM_DESC;
|
|||||||
#endif // DSP_ROM_DESC
|
#endif // DSP_ROM_DESC
|
||||||
/*********************************************************************************************/
|
/*********************************************************************************************/
|
||||||
Renderer *Init_uDisplay(const char *desc) {
|
Renderer *Init_uDisplay(const char *desc) {
|
||||||
char *ddesc = 0;
|
|
||||||
char *fbuff;
|
|
||||||
uDisplay *udisp;
|
|
||||||
|
|
||||||
if (TasmotaGlobal.gpio_optiona.udisplay_driver || desc) {
|
if (TasmotaGlobal.gpio_optiona.udisplay_driver || desc) {
|
||||||
|
|
||||||
Settings->display_model = XDSP_17;
|
Settings->display_model = XDSP_17;
|
||||||
|
|
||||||
|
char *fbuff = (char*)calloc(DISPDESC_SIZE, 1);
|
||||||
fbuff = (char*)calloc(DISPDESC_SIZE, 1);
|
|
||||||
if (!fbuff) return 0;
|
if (!fbuff) return 0;
|
||||||
|
|
||||||
|
char *ddesc = nullptr;
|
||||||
if (desc) {
|
if (desc) {
|
||||||
memcpy_P(fbuff, desc, DISPDESC_SIZE - 1);
|
memcpy_P(fbuff, desc, DISPDESC_SIZE - 1);
|
||||||
ddesc = fbuff;
|
ddesc = fbuff;
|
||||||
AddLog(LOG_LEVEL_DEBUG, PSTR("DSP: const char descriptor used"));
|
AddLog(LOG_LEVEL_DEBUG, PSTR("DSP: Const char descriptor used"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_UFILESYS
|
#ifdef USE_UFILESYS
|
||||||
@ -147,7 +143,9 @@ Renderer *Init_uDisplay(const char *desc) {
|
|||||||
|
|
||||||
if (!ddesc) {
|
if (!ddesc) {
|
||||||
AddLog(LOG_LEVEL_DEBUG, PSTR("DSP: No valid descriptor found"));
|
AddLog(LOG_LEVEL_DEBUG, PSTR("DSP: No valid descriptor found"));
|
||||||
if (fbuff) free(fbuff);
|
if (fbuff) {
|
||||||
|
free(fbuff);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,7 +341,7 @@ Renderer *Init_uDisplay(const char *desc) {
|
|||||||
AddLog(LOG_LEVEL_DEBUG, PSTR("DSP: reinit"));
|
AddLog(LOG_LEVEL_DEBUG, PSTR("DSP: reinit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
udisp = new uDisplay(ddesc);
|
uDisplay *udisp = new uDisplay(ddesc);
|
||||||
|
|
||||||
// check for touch option TI1 or TI2
|
// check for touch option TI1 or TI2
|
||||||
#if defined (USE_CST816S) || defined(USE_FT5206) || defined(USE_GT911)
|
#if defined (USE_CST816S) || defined(USE_FT5206) || defined(USE_GT911)
|
||||||
@ -503,7 +501,7 @@ Renderer *Init_uDisplay(const char *desc) {
|
|||||||
#endif // SHOW_SPLASH
|
#endif // SHOW_SPLASH
|
||||||
|
|
||||||
udisp_init_done = true;
|
udisp_init_done = true;
|
||||||
AddLog(LOG_LEVEL_INFO, PSTR("DSP: Configured display '%s'"), renderer->devname());
|
AddLog(LOG_LEVEL_INFO, PSTR("DSP: %s initialized"), renderer->devname());
|
||||||
|
|
||||||
return renderer;
|
return renderer;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user