display: Convert to Python3 string encoding

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2021-10-01 19:08:37 -04:00
parent cc2a313c10
commit 68b939c756
6 changed files with 279 additions and 279 deletions

View file

@ -10,7 +10,7 @@ BACKGROUND_PRIORITY_CLOCK = 0x7fffffff00000000
LINE_LENGTH_DEFAULT=20
LINE_LENGTH_OPTIONS={16:16, 20:20}
TextGlyphs = { 'right_arrow': '\x7e' }
TextGlyphs = { 'right_arrow': b'\x7e' }
HD44780_DELAY = .000040
@ -37,17 +37,17 @@ class HD44780:
self.send_data_cmd = self.send_cmds_cmd = None
self.icons = {}
# framebuffers
self.text_framebuffers = [bytearray(' '*2*self.line_length),
bytearray(' '*2*self.line_length)]
self.text_framebuffers = [bytearray(b' '*2*self.line_length),
bytearray(b' '*2*self.line_length)]
self.glyph_framebuffer = bytearray(64)
self.all_framebuffers = [
# Text framebuffers
(self.text_framebuffers[0], bytearray('~'*2*self.line_length),
(self.text_framebuffers[0], bytearray(b'~'*2*self.line_length),
0x80),
(self.text_framebuffers[1], bytearray('~'*2*self.line_length),
(self.text_framebuffers[1], bytearray(b'~'*2*self.line_length),
0xc0),
# Glyph framebuffer
(self.glyph_framebuffer, bytearray('~'*64), 0x40) ]
(self.glyph_framebuffer, bytearray(b'~'*64), 0x40) ]
def build_config(self):
self.mcu.add_config_cmd(
"config_hd44780 oid=%d rs_pin=%s e_pin=%s"
@ -127,7 +127,7 @@ class HD44780:
def write_graphics(self, x, y, data):
pass
def clear(self):
spaces = ' ' * 2*self.line_length
spaces = b' ' * 2*self.line_length
self.text_framebuffers[0][:] = spaces
self.text_framebuffers[1][:] = spaces
def get_dimensions(self):