From 0b944fddba3bb5c0e8df63ab3c00bd303a8bb54d Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 29 Sep 2021 16:36:33 +0200 Subject: [PATCH] Fix unwanted display interactions Fix unwanted display interactions when no display is configured --- tasmota/xdrv_13_display.ino | 57 +++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/tasmota/xdrv_13_display.ino b/tasmota/xdrv_13_display.ino index f4c280b4b..dd3567822 100755 --- a/tasmota/xdrv_13_display.ino +++ b/tasmota/xdrv_13_display.ino @@ -1782,38 +1782,39 @@ void DisplayLocalSensor(void) void DisplayInitDriver(void) { XdspCall(FUNC_DISPLAY_INIT_DRIVER); - ApplyDisplayDimmer(); - -#ifdef USE_MULTI_DISPLAY - Set_display(0); -#endif // USE_MULTI_DISPLAY - - if (renderer) { - renderer->setTextFont(Settings->display_font); - renderer->setTextSize(Settings->display_size); - // force opaque mode - renderer->setDrawMode(0); - - for (uint32_t cnt = 0; cnt < (MAX_INDEXCOLORS - PREDEF_INDEXCOLORS); cnt++) { - index_colors[cnt] = 0; - } - } - -#ifdef USE_DT_VARS - free_dt_vars(); -#endif - -#ifdef USE_UFILESYS - Display_Text_From_File(DISP_BATCH_FILE); -#endif - -#ifdef USE_GRAPH - for (uint8_t count = 0; count < NUM_GRAPHS; count++) { graph[count] = 0; } -#endif // AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_DEBUG "Display model %d"), Settings->display_model); if (Settings->display_model) { + ApplyDisplayDimmer(); + +#ifdef USE_MULTI_DISPLAY + Set_display(0); +#endif // USE_MULTI_DISPLAY + + if (renderer) { + renderer->setTextFont(Settings->display_font); + renderer->setTextSize(Settings->display_size); + // force opaque mode + renderer->setDrawMode(0); + + for (uint32_t cnt = 0; cnt < (MAX_INDEXCOLORS - PREDEF_INDEXCOLORS); cnt++) { + index_colors[cnt] = 0; + } + } + +#ifdef USE_DT_VARS + free_dt_vars(); +#endif + +#ifdef USE_UFILESYS + Display_Text_From_File(DISP_BATCH_FILE); +#endif + +#ifdef USE_GRAPH + for (uint8_t count = 0; count < NUM_GRAPHS; count++) { graph[count] = 0; } +#endif + TasmotaGlobal.devices_present++; if (!PinUsed(GPIO_BACKLIGHT)) { if (TasmotaGlobal.light_type && (4 == Settings->display_model)) {