|
|
|
|
@@ -418,8 +418,8 @@ void EInkDisplay::cleanupGrayscaleBuffers(const uint8_t* bwBuffer) {
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
void EInkDisplay::displayBuffer(RefreshMode mode) {
|
|
|
|
|
if (!isScreenOn) {
|
|
|
|
|
void EInkDisplay::displayBuffer(RefreshMode mode, const bool turnOffScreen) {
|
|
|
|
|
if (!isScreenOn && !turnOffScreen) {
|
|
|
|
|
// Force half refresh if screen is off
|
|
|
|
|
mode = HALF_REFRESH;
|
|
|
|
|
}
|
|
|
|
|
@@ -451,7 +451,7 @@ void EInkDisplay::displayBuffer(RefreshMode mode) {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// Refresh the display
|
|
|
|
|
refreshDisplay(mode);
|
|
|
|
|
refreshDisplay(mode, turnOffScreen);
|
|
|
|
|
|
|
|
|
|
#ifdef EINK_DISPLAY_SINGLE_BUFFER_MODE
|
|
|
|
|
// In single buffer mode always sync RED RAM after refresh to prepare for next fast refresh
|
|
|
|
|
@@ -464,7 +464,7 @@ void EInkDisplay::displayBuffer(RefreshMode mode) {
|
|
|
|
|
// EXPERIMENTAL: Windowed update support
|
|
|
|
|
// Displays only a rectangular region of the frame buffer, preserving the rest of the screen.
|
|
|
|
|
// Requirements: x and w must be byte-aligned (multiples of 8 pixels)
|
|
|
|
|
void EInkDisplay::displayWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h) {
|
|
|
|
|
void EInkDisplay::displayWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h, const bool turnOffScreen) {
|
|
|
|
|
Serial.printf("[%lu] Displaying window at (%d,%d) size (%dx%d)\n", millis(), x, y, w, h);
|
|
|
|
|
|
|
|
|
|
// Validate bounds
|
|
|
|
|
@@ -525,7 +525,7 @@ void EInkDisplay::displayWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// Perform fast refresh
|
|
|
|
|
refreshDisplay(FAST_REFRESH);
|
|
|
|
|
refreshDisplay(FAST_REFRESH, turnOffScreen);
|
|
|
|
|
|
|
|
|
|
#ifdef EINK_DISPLAY_SINGLE_BUFFER_MODE
|
|
|
|
|
// Post-refresh: Sync RED RAM with current window (for next fast refresh)
|
|
|
|
|
|