fix: wire through silent restart clear resume state with sdk (#2033)
## Summary After a silent reboot, there was a small window where the esp32 would listen for button presses but the full refresh would hold the event loop. This gave a UX experience where the silent reboot had completed to the home screen, a user taps select (at any time during the process), and they find themselves unexpectedly in a book. ## Additional Context This must land after https://github.com/crosspoint-reader/community-sdk/pull/11 and will need the submodule SHA changes included in. --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? partially
This commit is contained in:
+11
-7
@@ -18,14 +18,18 @@ void HalDisplay::begin(bool seamless) {
|
||||
|
||||
einkDisplay.begin();
|
||||
|
||||
if (seamless) {
|
||||
// Defuse the SDK's X3 _x3InitialFullSyncsRemaining counter (no-op on X4)
|
||||
// so the first paint isn't promoted to FULL (~770ms). Skips the wakeup-
|
||||
// gated requestResync() below for the same reason.
|
||||
einkDisplay.skipInitialResync();
|
||||
return;
|
||||
}
|
||||
// Request resync after specific wakeup events to ensure clean display state.
|
||||
// Skip when seamless=true so the current screen content is preserved.
|
||||
if (!seamless) {
|
||||
const auto wakeupReason = gpio.getWakeupReason();
|
||||
if (wakeupReason == HalGPIO::WakeupReason::PowerButton || wakeupReason == HalGPIO::WakeupReason::AfterFlash ||
|
||||
wakeupReason == HalGPIO::WakeupReason::Other) {
|
||||
einkDisplay.requestResync();
|
||||
}
|
||||
const auto wakeupReason = gpio.getWakeupReason();
|
||||
if (wakeupReason == HalGPIO::WakeupReason::PowerButton || wakeupReason == HalGPIO::WakeupReason::AfterFlash ||
|
||||
wakeupReason == HalGPIO::WakeupReason::Other) {
|
||||
einkDisplay.requestResync();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user