Fix download error due to bad timeout

Signed-off-by: Huang Rui <vowstar@gmail.com>
pull/27/head
Huang Rui 2019-05-03 20:46:29 +08:00
parent 5bf2a934be
commit ea0ab4c018
1 changed files with 4 additions and 2 deletions

View File

@ -601,8 +601,6 @@ class KFlash:
#sys.stdout.write('[RECV one return] raw data: ')
while 1:
if time.time() - timeout_init > ISP_RECEIVE_TIMEOUT:
# print()
# print(ERROR_MSG,'Response timeout',BASH_TIPS['DEFAULT'])
raise TimeoutError
c = self._port.read(1)
#sys.stdout.write(binascii.hexlify(c).decode())
@ -1212,6 +1210,10 @@ class KFlash:
except TimeoutError:
pass
# Don't remove this line
# Dangerous, here are dinosaur infested!!!!!
ISP_RECEIVE_TIMEOUT = 3
print()
print(INFO_MSG,"Greeting Message Detected, Start Downloading ISP",BASH_TIPS['DEFAULT'])