diff options
author | inmarket <andrewh@inmarket.com.au> | 2015-02-06 16:25:16 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2015-02-06 16:25:16 +1000 |
commit | 795b8a5e7dd88d920fd778cd03ad9c7b7825247e (patch) | |
tree | 412e74a0520978c1f35e1fe2ed44c98edc200636 /drivers/gdisp/SSD1306 | |
parent | a7bf3da17b0b6533777d75811f9d8c13fb346e9b (diff) | |
download | uGFX-795b8a5e7dd88d920fd778cd03ad9c7b7825247e.tar.gz uGFX-795b8a5e7dd88d920fd778cd03ad9c7b7825247e.tar.bz2 uGFX-795b8a5e7dd88d920fd778cd03ad9c7b7825247e.zip |
Fix optimization code that broke the SSD1306 for I2C interfaces.
Diffstat (limited to 'drivers/gdisp/SSD1306')
-rw-r--r-- | drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c | 15 | ||||
-rw-r--r-- | drivers/gdisp/SSD1306/gdisp_lld_config.h | 1 |
2 files changed, 3 insertions, 13 deletions
diff --git a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c index 898c6ece..a8980ce7 100644 --- a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c +++ b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c @@ -157,15 +157,6 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { } #endif -#if GDISP_HARDWARE_CLEARS - LLDSPEC void gdisp_lld_clear(GDisplay *g) { - uint8_t fill = (gdispColor2Native(g->p.color) == gdispColor2Native(Black)) ? 0 : 0xff; - int bytes = GDISP_SCREEN_WIDTH * GDISP_SCREEN_HEIGHT/8; - memset(RAM(g), fill, bytes); - g->flags |= GDISP_FLG_NEEDFLUSH; - } -#endif - #if GDISP_HARDWARE_FILLS LLDSPEC void gdisp_lld_fill_area(GDisplay *g) { coord_t sy, ey; @@ -204,7 +195,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { } spage = sy / 8; - base = RAM(g) + GDISP_SCREEN_WIDTH * spage; + base = RAM(g) + SSD1306_PAGE_OFFSET + SSD1306_PAGE_WIDTH * spage; mask = 0xff << (sy&7); zpages = (ey / 8) - spage; @@ -213,7 +204,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { for (col = sx; col <= ex; col++) base[col] &= ~mask; mask = 0xff; - base += GDISP_SCREEN_WIDTH; + base += SSD1306_PAGE_WIDTH; } mask &= (0xff >> (7 - (ey&7))); for (col = sx; col <= ex; col++) @@ -223,7 +214,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { for (col = sx; col <= ex; col++) base[col] |= mask; mask = 0xff; - base += GDISP_SCREEN_WIDTH; + base += SSD1306_PAGE_WIDTH; } mask &= (0xff >> (7 - (ey&7))); for (col = sx; col <= ex; col++) diff --git a/drivers/gdisp/SSD1306/gdisp_lld_config.h b/drivers/gdisp/SSD1306/gdisp_lld_config.h index a0961dcf..dfb91f97 100644 --- a/drivers/gdisp/SSD1306/gdisp_lld_config.h +++ b/drivers/gdisp/SSD1306/gdisp_lld_config.h @@ -18,7 +18,6 @@ #define GDISP_HARDWARE_DRAWPIXEL TRUE
#define GDISP_HARDWARE_PIXELREAD TRUE
#define GDISP_HARDWARE_CONTROL TRUE
-#define GDISP_HARDWARE_CLEARS TRUE
#define GDISP_HARDWARE_FILLS TRUE
#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO
|