Hook when new serial port is the same in boot mode

This commit is contained in:
Ivan Kravets
2016-06-03 01:16:16 +03:00
parent 882bddf77e
commit 190ffab76d

View File

@ -48,7 +48,6 @@ def TouchSerialPort(env, port, baudrate):
def WaitForNewSerialPort(env, before):
sleep(0.5)
new_port = None
elapsed = 0
while elapsed < 10:
@ -62,6 +61,9 @@ def WaitForNewSerialPort(env, before):
sleep(0.25)
elapsed += 0.25
if not new_port and env.subst("$UPLOAD_PORT") in now:
new_port = env.subst("$UPLOAD_PORT")
if not new_port:
env.Exit("Error: Couldn't find a board on the selected port. "
"Check that you have the correct port selected. "