Skip to content

Commit ebc32cd

Browse files
gwendal-hmathoudebine
authored andcommitted
Fix UPDATE_BITMAP when image_size > 65535
Fix the UPDATE_BITMAP command when drawing a big image (image size > 65535) This bug happened when trying to draw a long text with a big font size.
1 parent ed2cfe5 commit ebc32cd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

library/lcd/lcd_comm_rev_c.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class Command(Enum):
7777
# STATIC IMAGE
7878
START_DISPLAY_BITMAP = bytearray((0x2c,))
7979
PRE_UPDATE_BITMAP = bytearray((0x86, 0xef, 0x69, 0x00, 0x00, 0x00, 0x01))
80-
UPDATE_BITMAP = bytearray((0xcc, 0xef, 0x69, 0x00, 0x00))
80+
UPDATE_BITMAP = bytearray((0xcc, 0xef, 0x69, 0x00))
8181

8282
RESTARTSCREEN = bytearray((0x84, 0xef, 0x69, 0x00, 0x00, 0x00, 0x01))
8383
DISPLAY_BITMAP = bytearray((0xc8, 0xef, 0x69, 0x00, 0x17, 0x70))
@@ -352,7 +352,7 @@ def _generate_update_image(self, image, x, y, count, cmd: Command = None,
352352
img_raw_data.append(f'{current_pixel[2]:02x}{current_pixel[1]:02x}{current_pixel[0]:02x}')
353353

354354
image_msg = ''.join(img_raw_data)
355-
image_size = f'{int((len(image_msg) / 2) + 2):04x}' # The +2 is for the "ef69" that will be added later.
355+
image_size = f'{int((len(image_msg) / 2) + 2):06x}' # The +2 is for the "ef69" that will be added later.
356356

357357
# logger.debug("Render Count: {}".format(count))
358358
payload = bytearray()

0 commit comments

Comments
 (0)