From 1379a590854afdc8dbdedf7f5807039ad0bfe785 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 20 Sep 2018 14:29:19 -0400 Subject: [PATCH] st7920: No need to clear glyph framebuffer before programming glyphs Signed-off-by: Kevin O'Connor --- klippy/extras/display/st7920.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/klippy/extras/display/st7920.py b/klippy/extras/display/st7920.py index 4d002abd..9d575218 100644 --- a/klippy/extras/display/st7920.py +++ b/klippy/extras/display/st7920.py @@ -108,18 +108,19 @@ class ST7920: 0x06, # Set positive update direction 0x0c] # Enable display and hide cursor self.send(cmds) - self.flush() # Setup animated glyphs self.cache_glyph('fan1', 0) self.cache_glyph('fan2', 1) self.cache_glyph('bed_heat1', 2) self.cache_glyph('bed_heat2', 3) + self.flush() def cache_glyph(self, glyph_name, glyph_id): icon = icons.Icons16x16[glyph_name] for i, bits in enumerate(icon): pos = glyph_id*32 + i*2 - data = [(bits >> 8) & 0xff, bits & 0xff] - self.glyph_framebuffer[pos:pos+len(data)] = data + b1, b2 = (bits >> 8) & 0xff, bits & 0xff + self.glyph_framebuffer[pos:pos+2] = [b1, b2] + self.all_framebuffers[1][1][pos:pos+2] = [b1 ^ 1, b2 ^ 1] self.cached_glyphs[glyph_name] = (0, glyph_id*2) def write_text(self, x, y, data): if x + len(data) > 16: