From f77c5f6a5bb42ea5d28cb2db54417d2694acc7c9 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Thu, 22 Aug 2024 10:50:44 -0700 Subject: [PATCH] Don't create backlight instances when the variant hasn't specified a pin --- src/graphics/TFTDisplay.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/graphics/TFTDisplay.cpp b/src/graphics/TFTDisplay.cpp index 7a0a8c3eb..f6bd6513a 100644 --- a/src/graphics/TFTDisplay.cpp +++ b/src/graphics/TFTDisplay.cpp @@ -192,6 +192,7 @@ class LGFX : public lgfx::LGFX_Device _panel_instance.config(cfg); } +#ifdef ST7789_BL // Set the backlight control. (delete if not necessary) { auto cfg = _light_instance.config(); // Gets a structure for backlight settings. @@ -203,6 +204,7 @@ class LGFX : public lgfx::LGFX_Device _light_instance.config(cfg); _panel_instance.setLight(&_light_instance); // Set the backlight on the panel. } +#endif #if HAS_TOUCHSCREEN // Configure settings for touch screen control. @@ -312,6 +314,7 @@ class LGFX : public lgfx::LGFX_Device _panel_instance.config(cfg); } +#ifdef TFT_BL // Set the backlight control { auto cfg = _light_instance.config(); // Gets a structure for backlight settings. @@ -324,6 +327,7 @@ class LGFX : public lgfx::LGFX_Device _light_instance.config(cfg); _panel_instance.setLight(&_light_instance); // Set the backlight on the panel. } +#endif setPanel(&_panel_instance); }