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