diff options
author | ergosys <ergosys@gmail.com> | 2014-12-11 22:54:19 -0800 |
---|---|---|
committer | ergosys <ergosys@gmail.com> | 2014-12-12 16:21:08 -0800 |
commit | 3b12678e6ed14c7e78aae141cbc31994559e73ce (patch) | |
tree | a3afb5f7e19335d7516f6bf03829174c5daab2ca /drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c | |
parent | 96a5f5fbea7333443d9c0eeac57e3cb975494aa1 (diff) | |
download | uGFX-3b12678e6ed14c7e78aae141cbc31994559e73ce.tar.gz uGFX-3b12678e6ed14c7e78aae141cbc31994559e73ce.tar.bz2 uGFX-3b12678e6ed14c7e78aae141cbc31994559e73ce.zip |
add hardware clear
Diffstat (limited to 'drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c')
-rw-r--r-- | drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c | 10 |
1 files changed, 10 insertions, 0 deletions
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; |