MCPcopy Create free account
hub / github.com/crosspoint-reader/crosspoint-reader / begin

Method begin

lib/hal/HalDisplay.cpp:13–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11HalDisplay::~HalDisplay() {}
12
13void HalDisplay::begin(bool seamless) {
14 // Set X3-specific panel mode before initializing.
15 if (gpio.deviceIsX3()) {
16 einkDisplay.setDisplayX3();
17 }
18
19 einkDisplay.begin();
20
21 if (seamless) {
22 // Defuse the SDK's X3 _x3InitialFullSyncsRemaining counter (no-op on X4)
23 // so the first paint isn't promoted to FULL (~770ms). Skips the wakeup-
24 // gated requestResync() below for the same reason.
25 einkDisplay.skipInitialResync();
26 return;
27 }
28 // Request resync after specific wakeup events to ensure clean display state.
29 const auto wakeupReason = gpio.getWakeupReason();
30 if (wakeupReason == HalGPIO::WakeupReason::PowerButton || wakeupReason == HalGPIO::WakeupReason::AfterFlash ||
31 wakeupReason == HalGPIO::WakeupReason::Other) {
32 einkDisplay.requestResync();
33 }
34}
35
36void HalDisplay::clearScreen(uint8_t color) const { einkDisplay.clearScreen(color); }
37

Callers

nothing calls this directly

Calls 2

deviceIsX3Method · 0.80
getWakeupReasonMethod · 0.80

Tested by

no test coverage detected