From 3b12678e6ed14c7e78aae141cbc31994559e73ce Mon Sep 17 00:00:00 2001 From: ergosys Date: Thu, 11 Dec 2014 22:54:19 -0800 Subject: add hardware clear --- drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c') diff --git a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c index f241270e..9670d2d0 100644 --- a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c +++ b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c @@ -151,6 +151,16 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { } #endif +#if GDISP_HARDWARE_CLEARS + LLDSPEC void gdisp_lld_clear(GDisplay *g) { + uint8_t fill = (g->p.color == Black) ? 0 : 0xff; + int bytes = GDISP_SCREEN_WIDTH * GDISP_SCREEN_HEIGHT/8; + int off; + for (off = 0; off < bytes; off++) + RAM(g)[off] = fill; + } +#endif + #if GDISP_HARDWARE_DRAWPIXEL LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { coord_t x, y; -- cgit v1.2.3