aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@embedded.pro>2017-02-28 16:58:57 +0100
committerJoel Bodenmann <joel@embedded.pro>2017-02-28 16:58:57 +0100
commit7cc28e8f0d4b44235e1e7ef70a4ffd365e5f138d (patch)
treecbd6a6647d2b3a6633fd1aefc9d1e36413519e0f
parent6956df1652c51eaddf5cd882f7fcde6571b240da (diff)
downloaduGFX-7cc28e8f0d4b44235e1e7ef70a4ffd365e5f138d.tar.gz
uGFX-7cc28e8f0d4b44235e1e7ef70a4ffd365e5f138d.tar.bz2
uGFX-7cc28e8f0d4b44235e1e7ef70a4ffd365e5f138d.zip
Improving UC8173 driver
-rw-r--r--drivers/gdisp/UC8173/gdisp_lld_UC8173.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gdisp/UC8173/gdisp_lld_UC8173.c b/drivers/gdisp/UC8173/gdisp_lld_UC8173.c
index 75a4a237..2a485925 100644
--- a/drivers/gdisp/UC8173/gdisp_lld_UC8173.c
+++ b/drivers/gdisp/UC8173/gdisp_lld_UC8173.c
@@ -32,7 +32,7 @@
#endif
#define PRIV(g) ((UC8173_Private*)((g)->priv))
-#define FRAMEBUFFER(g) (PRIV(g)->framebuffer)
+#define FRAMEBUFFER(g) ((uint8_t*)(PRIV(g))+1)
#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER << 0)
#if GDISP_LLD_PIXELFORMAT == GDISP_PIXELFORMAT_MONO
@@ -56,7 +56,6 @@ typedef struct UC8173_Private {
coord_t flushWindowY;
coord_t flushWindowWidth;
coord_t flushWindowHeight;
- uint8_t* framebuffer;
} UC8173_Private;
// This function rounds a given integer up to a specified multiple. Note, multiple must be a power of 2!
@@ -149,7 +148,6 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay* g)
PRIV(g)->flushWindowY = 0;
PRIV(g)->flushWindowWidth = GDISP_SCREEN_WIDTH;
PRIV(g)->flushWindowHeight = GDISP_SCREEN_HEIGHT;
- PRIV(g)->framebuffer = (uint8_t*)(PRIV(g) + offsetof(UC8173_Private, framebuffer));
// Initialise the board interface
if (!init_board(g)) {
@@ -368,7 +366,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay* g)
y = g->p.x;
break;
}
-
+
// Modify the framebuffer content
p = &FRAMEBUFFER(g)[xyaddr(x,y)];
*p &=~ xybit(x, LLDCOLOR_MASK());