ch9329: fixed int to byte conversion

This commit is contained in:
Maxim Devaev 2023-06-01 17:35:16 +03:00
parent 2730b11840
commit 2e6f0da141

View File

@ -44,8 +44,8 @@ class Chip:
if len(cmd) == 0: if len(cmd) == 0:
cmd = b"\x00\x01\x00" cmd = b"\x00\x01\x00"
cmd = b"\x57\xAB" + cmd cmd = b"\x57\xAB" + cmd
cmd += self.__make_checksum(cmd).to_bytes() cmd += self.__make_checksum(cmd).to_bytes(1, "big")
self.__tty.write(serial.to_bytes(cmd)) self.__tty.write(cmd)
def __recv(self) -> int: def __recv(self) -> int:
data = self.__tty.read(5) data = self.__tty.read(5)