Skip to content

Commit 496e036

Browse files
authored
Merge pull request #701 from mathoudebine/fix/698-python-311-typeerror-to_bytes-missing-required-argument-byteorder-pos-2
2 parents 3a7c35b + 0f795a1 commit 496e036

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

library/lcd/lcd_comm_rev_c.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def DisplayPILImage(
339339
display_bmp_cmd = Command.DISPLAY_BITMAP_8INCH
340340

341341
self._send_command(display_bmp_cmd,
342-
payload=bytearray(int(self.display_width * self.display_width / 64).to_bytes(2)))
342+
payload=bytearray(int(self.display_width * self.display_width / 64).to_bytes(2, "big")))
343343
self._send_command(Command.SEND_PAYLOAD,
344344
payload=bytearray(self._generate_full_image(image)),
345345
readsize=1024)

library/lcd/lcd_comm_rev_d.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def Reset(self):
8989
def Clear(self):
9090
# HW revision D does not implement a Clear command: display a blank image on the whole screen
9191
color = 0xFFFF # RGB565 White color
92-
color_bytes = bytearray(color.to_bytes(2))
92+
color_bytes = bytearray(color.to_bytes(2, "big"))
9393
self.SendCommand(cmd=Command.DISPCOLOR, payload=color_bytes)
9494

9595
def ScreenOff(self):

0 commit comments

Comments
 (0)