aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/display/st7920.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-09-20 14:29:19 -0400
committerKevinOConnor <kevin@koconnor.net>2018-09-21 16:39:38 -0400
commit1379a590854afdc8dbdedf7f5807039ad0bfe785 (patch)
tree18bdce57625fe153850a79a109601eab982cd1b5 /klippy/extras/display/st7920.py
parent7cca8d970ac7d19784d621865100470de2fa8092 (diff)
downloadkutter-1379a590854afdc8dbdedf7f5807039ad0bfe785.tar.gz
kutter-1379a590854afdc8dbdedf7f5807039ad0bfe785.tar.xz
kutter-1379a590854afdc8dbdedf7f5807039ad0bfe785.zip
st7920: No need to clear glyph framebuffer before programming glyphs
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/display/st7920.py')
-rw-r--r--klippy/extras/display/st7920.py7
1 files 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: