Skip to content

Commit ab7ff57

Browse files
chrisrukgrega
authored andcommitted
Resend 'version' if we get empty data back
1 parent 7e27ff2 commit ab7ff57

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

buildhat/serinterface.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,9 @@ def __init__(self, firmware, signature, version, device="/dev/serial0", debug=Fa
117117
# Check if we're in the bootloader or the firmware
118118
self.write(b"version\r")
119119

120-
emptydata = 0
121120
incdata = 0
122121
while True:
123122
line = self.read()
124-
if len(line) == 0:
125-
# Didn't receive any data
126-
emptydata += 1
127-
if emptydata > 3:
128-
break
129-
else:
130-
continue
131123
if cmp(line, BuildHAT.FIRMWARE):
132124
self.state = HatState.FIRMWARE
133125
ver = line[len(BuildHAT.FIRMWARE):].split(' ')

0 commit comments

Comments
 (0)