aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2018-04-03 13:43:01 +1000
committerinmarket <andrewh@inmarket.com.au>2018-04-03 13:43:01 +1000
commitef9d93f0efd13843ca2f3bb7c3bafcfbf4910899 (patch)
tree55ab6c7a656462ffd80f17dc6dfebf1ff24e476c /drivers
parenta70cc09ff9159876edbb157ff2af4b2f18abf45a (diff)
downloaduGFX-ef9d93f0efd13843ca2f3bb7c3bafcfbf4910899.tar.gz
uGFX-ef9d93f0efd13843ca2f3bb7c3bafcfbf4910899.tar.bz2
uGFX-ef9d93f0efd13843ca2f3bb7c3bafcfbf4910899.zip
Fix UC1610 driver private area initialisation
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gdisp/UC1610/gdisp_lld_UC1610.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gdisp/UC1610/gdisp_lld_UC1610.c b/drivers/gdisp/UC1610/gdisp_lld_UC1610.c
index b602c991..67b74d90 100644
--- a/drivers/gdisp/UC1610/gdisp_lld_UC1610.c
+++ b/drivers/gdisp/UC1610/gdisp_lld_UC1610.c
@@ -96,6 +96,12 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
// The private area is the display surface + flush window structure.
g->priv = gfxAlloc(sizeof(UC1610_Window) + GDISP_SCREEN_WIDTH * GDISP_SCREEN_HEIGHT / UC1610_PAGE_HEIGHT);
+ // Clear the initial flush region
+ PRIV(g)->x1 = GDISP_SCREEN_WIDTH;
+ PRIV(g)->y1 = GDISP_SCREEN_HEIGHT;
+ PRIV(g)->x2 = -1;
+ PRIV(g)->y2 = -1;
+
// Initialise the board interface
init_board(g);
@@ -176,7 +182,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
x2 = PRIV(g)->x2;
y2 = PRIV(g)->y2;
cx = x2 - x1 + 1;
-
+
// Clear the 'need-flushing' flag and reset the window
g->flags &= ~GDISP_FLG_NEEDFLUSH;
PRIV(g)->x1 = GDISP_SCREEN_WIDTH;
@@ -195,10 +201,10 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
cmdBuffer[7] = UC1610_SET_WP_ENDING_PA;
cmdBuffer[8] = y2 >> 2;
cmdBuffer[9] = UC1610_SET_WINDOW_PROGRAM_ENABLE | 1; // entering window programming
-
+
acquire_bus(g);
write_cmd (g, cmdBuffer, 10);
-
+
// write each page segment from RAM(g) to display RAM
for (c = RAM(g) + xyaddr(x1, y1) ; y1 <= y2 ; c += GDISP_SCREEN_WIDTH, y1 += UC1610_PAGE_HEIGHT) {
write_data(g, c, cx);