Skip to content

Commit 8803c97

Browse files
committed
Fix flasher does not work with python2
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 3d91bb4 commit 8803c97

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

siwiflasher.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,10 @@ def __init__(self, ser):
173173

174174
def crc_word(self, data, chs=0):
175175
for i in xrange(0, len(data), 1):
176-
chs += data[i] & 0xFF
176+
if (sys.version_info[0] < 3):
177+
chs += ord(data[i]) & 0xFF
178+
else:
179+
chs += data[i] & 0xFF
177180
return chs & 0xFFFF
178181

179182
def send(self, data, sz=0):

0 commit comments

Comments
 (0)