From 2f97112987af311ca81dd70b83cbcf7236d6c119 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 30 Jun 2026 16:47:32 -0500 Subject: [PATCH] Enhance TFTDisplay with board-specific driver support (#10827) Added conditional inclusion for board-specific framebuffer backends and updated comments for clarity. --- src/graphics/TFTDisplay.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/graphics/TFTDisplay.cpp b/src/graphics/TFTDisplay.cpp index e6fd16e66..37f73392b 100644 --- a/src/graphics/TFTDisplay.cpp +++ b/src/graphics/TFTDisplay.cpp @@ -1142,8 +1142,17 @@ class LGFX : public lgfx::LGFX_Device static LGFX *tft = nullptr; -#endif +#elif defined(VARIANT_DISPLAY_DRIVER) +// Board-specific framebuffer backends (class LGFX) can livee in the +// variant files — variant_display.h (declaration) and +// variant_display.cpp (bodies) — so this shared +// file isn't inflated for a single board. It exposes the same surface TFTDisplay +// drives, so the generic `tft = new LGFX;` in connect() works. +#include "variant_display.h" +static LGFX *tft = nullptr; + +#endif #include "SPILock.h" #include "TFTColorRegions.h" #include "TFTDisplay.h"