From 02bae4ffbbc3235c23f6c42f73c43376bdcd02c5 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 14 Oct 2026 01:34:29 +0000 Subject: [PATCH] Bench: a flag to suppress the TFT render task MESHTASTIC_BENCH_NO_TFT_TASK initializes the panel as usual but never starts the render loop, so a board whose panel shares the radio's SPI bus can be run with and without display bus traffic from otherwise identical firmware. Bench only; undefined it preprocesses away to today's code. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Y5ccEnKA2TfgCLVHmaZ4Fh --- src/graphics/tftSetup.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/graphics/tftSetup.cpp b/src/graphics/tftSetup.cpp index c4e9481508..86c5b117e0 100644 --- a/src/graphics/tftSetup.cpp +++ b/src/graphics/tftSetup.cpp @@ -429,7 +429,14 @@ void tftSetup(void) } tftSleepObserver->observe(¬ifyLightSleep); endSleepObserver->observe(¬ifyLightSleepEnd); +#ifdef MESHTASTIC_BENCH_NO_TFT_TASK + // Bench only: the panel is initialized above, so the bus comes up exactly as it does in a + // normal boot, but no render loop runs afterwards. On a board whose panel shares the radio's + // SPI bus that isolates the display's bus traffic as a single variable. + LOG_WARN("BENCH: TFT render task suppressed, no display SPI traffic"); +#else xTaskCreatePinnedToCore(tft_task_handler, "tft", TFT_TASK_STACK_SIZE, NULL, 1, NULL, 0); +#endif #elif defined(ARCH_PORTDUINO) std::thread *tft_task = new std::thread([] { tft_task_handler(); }); #endif