feat(screen): stream the TFT color-region palette for color-accurate mirroring

ScreenMirror captures the color-region table with each snapshot when the
frame signature changes (regions byte-swapped from panel order to logical
RGB565, defaults = White / theme body background) and streams it as
FromRadio.display_palette chunks ahead of frames, with per-client
(signature, region) cursors like the frame drain. Frames reference the
palette via palette_signature; monochrome-only builds send 0 and no
palettes. Also classify USE_TFTDISPLAY/HAS_SPI_TFT panels (T-Deck) as
TFT in DeviceMetadata.display.
This commit is contained in:
James Rich committed 2026-11-03 07:39:17 -06:00
1 parent 270bf00f6c
commit 1ed930ec2d
5 files changed
+150 -3

No files matched your search

+27
View File
@@ -1392,6 +1392,33 @@ extern meshtastic_DeviceMetadata getDeviceMetadata()
#if !(MESHTASTIC_EXCLUDE_PKI) && !(MESHTASTIC_EXCLUDE_XEDDSA)
deviceMetadata.has_xeddsa = true;
#endif
#if HAS_SCREEN
if (screen) {
OLEDDisplay *dispdev = screen->getDisplayDevice();
if (dispdev && dispdev->getWidth() > 0) {
deviceMetadata.has_display = true;
deviceMetadata.display.width = dispdev->getWidth();
deviceMetadata.display.height = dispdev->getHeight();
deviceMetadata.display.format = meshtastic_DisplayFrame_Format_MONO_VLSB;
#if defined(USE_EINK)
deviceMetadata.display.panel_class = meshtastic_DisplayInfo_PanelClass_EINK;
#elif defined(USE_HUB75) || defined(HAS_HUB75_NATIVE)
deviceMetadata.display.panel_class = meshtastic_DisplayInfo_PanelClass_HUB75;
#elif defined(USE_TFTDISPLAY) || defined(HAS_SPI_TFT) || defined(USE_ST7789) || defined(USE_ST7796) || \
defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER)
deviceMetadata.display.panel_class = meshtastic_DisplayInfo_PanelClass_TFT;
#elif defined(USE_ST7567)
deviceMetadata.display.panel_class = meshtastic_DisplayInfo_PanelClass_LCD;
#else
deviceMetadata.display.panel_class = meshtastic_DisplayInfo_PanelClass_OLED;
#endif
#ifdef HAS_TOUCHSCREEN
deviceMetadata.display.has_touch = true;
#endif
}
}
#endif
return deviceMetadata;
}