Add quick resume

This commit is contained in:
jpirnay
2026-05-21 23:13:28 +02:00
parent ce521a63aa
commit 5bb3980dc0
40 changed files with 262 additions and 26 deletions
+9 -6
View File
@@ -10,7 +10,7 @@ HalDisplay::HalDisplay() : einkDisplay(EPD_SCLK, EPD_MOSI, EPD_CS, EPD_DC, EPD_R
HalDisplay::~HalDisplay() {}
void HalDisplay::begin() {
void HalDisplay::begin(bool seamless) {
// Set X3-specific panel mode before initializing.
if (gpio.deviceIsX3()) {
einkDisplay.setDisplayX3();
@@ -18,11 +18,14 @@ void HalDisplay::begin() {
einkDisplay.begin();
// Request resync after specific wakeup events to ensure clean display state
const auto wakeupReason = gpio.getWakeupReason();
if (wakeupReason == HalGPIO::WakeupReason::PowerButton || wakeupReason == HalGPIO::WakeupReason::AfterFlash ||
wakeupReason == HalGPIO::WakeupReason::Other) {
einkDisplay.requestResync();
// Request resync after specific wakeup events to ensure clean display state.
// Skip when seamless=true so the current panel content is preserved (Quick Resume).
if (!seamless) {
const auto wakeupReason = gpio.getWakeupReason();
if (wakeupReason == HalGPIO::WakeupReason::PowerButton || wakeupReason == HalGPIO::WakeupReason::AfterFlash ||
wakeupReason == HalGPIO::WakeupReason::Other) {
einkDisplay.requestResync();
}
}
}
+4 -2
View File
@@ -17,8 +17,10 @@ class HalDisplay {
FAST_REFRESH // Fast refresh using custom LUT
};
// Initialize the display hardware and driver
void begin();
// Initialize the display hardware and driver.
// When seamless=true, skip the on-wake resync so existing panel content is preserved
// (used by Quick Resume to bring back the last reader page without a boot screen).
void begin(bool seamless = false);
// Display dimensions
static constexpr uint16_t DISPLAY_WIDTH = EInkDisplay::DISPLAY_WIDTH;