aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c')
-rw-r--r--drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c10
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;