mirror of
https://github.com/crosspoint-reader/crosspoint-reader.git
synced 2026-04-29 10:26:52 -07:00
Updates to X3-specific display and power button handling
Centralize display initialization and power button verification for X3 devices
This commit is contained in:
+16
-1
@@ -7,7 +7,22 @@ HalDisplay::HalDisplay() : einkDisplay(EPD_SCLK, EPD_MOSI, EPD_CS, EPD_DC, EPD_R
|
||||
|
||||
HalDisplay::~HalDisplay() {}
|
||||
|
||||
void HalDisplay::begin() { einkDisplay.begin(); }
|
||||
void HalDisplay::begin() {
|
||||
// Set X3-specific display dimensions before initializing
|
||||
if (gpio.deviceIsX3()) {
|
||||
einkDisplay.setDisplayDimensions(792, 528);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
void HalDisplay::setDisplayDimensions(uint16_t width, uint16_t height) {
|
||||
einkDisplay.setDisplayDimensions(width, height);
|
||||
|
||||
Reference in New Issue
Block a user