From bae59ff42467e9f857bedbad6356e23dddc7f57c Mon Sep 17 00:00:00 2001 From: torlando-tech Date: Wed, 4 Mar 2026 17:48:38 -0500 Subject: [PATCH] Fix unused BG_COLOR warning and make show_splash() private Move BG_COLOR inline into #ifndef block to avoid unused variable when HAS_SPLASH_IMAGE is defined. Make show_splash() private since it's only called internally from init_hardware_only(). Co-Authored-By: Claude Opus 4.6 --- lib/tdeck_ui/Hardware/TDeck/Display.cpp | 11 +++-------- lib/tdeck_ui/Hardware/TDeck/Display.h | 9 ++------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/lib/tdeck_ui/Hardware/TDeck/Display.cpp b/lib/tdeck_ui/Hardware/TDeck/Display.cpp index 30924e2c..49184e6e 100644 --- a/lib/tdeck_ui/Hardware/TDeck/Display.cpp +++ b/lib/tdeck_ui/Hardware/TDeck/Display.cpp @@ -174,14 +174,9 @@ void Display::set_power(bool on) { } void Display::show_splash() { - // Background color: #1D1A1E -> RGB565 0x18C3 - static const uint16_t BG_COLOR = 0x18C3; - -#ifdef HAS_SPLASH_IMAGE - // Full-screen splash has background baked in — skip redundant fill -#else - // No splash image — fill with background color - fill_screen(BG_COLOR); +#ifndef HAS_SPLASH_IMAGE + // No splash image — fill with background color (#1D1A1E -> RGB565 0x18C3) + fill_screen(0x18C3); #endif #ifdef HAS_SPLASH_IMAGE diff --git a/lib/tdeck_ui/Hardware/TDeck/Display.h b/lib/tdeck_ui/Hardware/TDeck/Display.h index 5bab54e3..fcc56297 100644 --- a/lib/tdeck_ui/Hardware/TDeck/Display.h +++ b/lib/tdeck_ui/Hardware/TDeck/Display.h @@ -68,13 +68,6 @@ public: */ static void draw_rect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); - /** - * Show boot splash image (centered Pyxis logo) - * Called during init_registers() before backlight turns on. - * Falls back to black screen if SplashImage.h not generated. - */ - static void show_splash(); - /** * LVGL flush callback - called by LVGL to update display * Do not call directly - used internally by LVGL @@ -82,6 +75,8 @@ public: static void lvgl_flush_cb(lv_disp_drv_t* drv, const lv_area_t* area, lv_color_t* color_p); private: + // Show boot splash image, called from init_hardware_only() + static void show_splash(); // SPI commands for ST7789V enum Command : uint8_t { NOP = 0x00,