From 0a57c0a5a7b96809418f244515999b31e2a8cd55 Mon Sep 17 00:00:00 2001 From: Justin Mitchell Date: Wed, 24 Jun 2026 21:26:57 -0400 Subject: [PATCH] Fix X3 display ghosting on cover screen transitions Force display resync on X3 when HALF refresh is requested to clear prior content before rendering. Add grayscale preconditioning for X3's UC81xx controller to even out single-pixel dithering artifacts that appear as speckle with its turbo BW waveform. --- lib/hal/HalDisplay.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/hal/HalDisplay.cpp b/lib/hal/HalDisplay.cpp index e3a5b644..f90e85c0 100644 --- a/lib/hal/HalDisplay.cpp +++ b/lib/hal/HalDisplay.cpp @@ -82,6 +82,17 @@ void HalDisplay::copyGrayscaleBuffers(const uint8_t* lsbBuffer, const uint8_t* m } void HalDisplay::displayGrayscaleBase(RefreshMode fallback, bool turnOffScreen) { + // X3: a HALF fallback means the caller wants a clean base (e.g. the sleep + // cover, a full-screen swap from arbitrary prior content). Without this, the + // X3 grayscale base takes its gentle differential happy path and the prior + // home/reader frame ghosts through the soft aa_pre_bw_mid waveform. Forcing a + // resync makes displayGrayscaleBase clear first, matching displayBuffer(HALF). + // The reader's FAST path is deliberately left on the differential path so + // per-page grayscale stays cheap. + if (gpio.deviceIsX3() && fallback == RefreshMode::HALF_REFRESH) { + einkDisplay.requestResync(1); + } + einkDisplay.displayGrayscaleBase(convertRefreshMode(fallback), turnOffScreen); }