🐛 Fix checksum calculation in stk500v2 under py3

See #3382
This commit is contained in:
Gina Häußge committed 2019-12-11 10:50:40 +01:00
1 parent 9f85b54681
commit b06c222a7d
1 file changed
+2 -2
+2 -2
View File
@@ -98,8 +98,8 @@ class Stk500v2(ispBase.IspBase):
for c in data:
message += struct.pack(">B", c)
checksum = 0
for c in message:
checksum ^= ord(c)
for c in bytearray(message):
checksum ^= c
message += struct.pack(">B", checksum)
try:
self.serial.write(message)