Skip to content

Commit 7f7a2ce

Browse files
gemu2015Gerhard Mutz
andauthored
fix monochrome pushpixels (#24388)
Co-authored-by: Gerhard Mutz <[email protected]>
1 parent 7a6253f commit 7f7a2ce

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/lib_display/UDisplay/src/uDisplay_graphics.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ void uDisplay::pushColors(uint16_t *data, uint32_t len, boolean not_swapped) {
7272
if (lvgl_param.swap_color) {
7373
not_swapped = !not_swapped;
7474
}
75-
universal_panel->pushColors(data, len, not_swapped);
75+
if (!universal_panel->pushColors(data, len, not_swapped)) {
76+
pushColorsMono(data, len, not_swapped);
77+
}
7678
}
7779

7880
// convert to mono, these are framebuffer based
@@ -104,7 +106,12 @@ void uDisplay::pushColorsMono(uint16_t *data, uint32_t len, bool rgb16_swap) {
104106
}
105107

106108
void uDisplay::setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) {
107-
universal_panel->setAddrWindow(x0, y0, x1, y1);
109+
if (!universal_panel->setAddrWindow(x0, y0, x1, y1)) {
110+
seta_xp1 = x0;
111+
seta_yp1 = y0;
112+
seta_xp2 = x1;
113+
seta_yp2 = y1;
114+
}
108115
}
109116

110117
void uDisplay::setRotation(uint8_t rotation) {

0 commit comments

Comments
 (0)