diff --git a/platformio/builder/tools/pioupload.py b/platformio/builder/tools/pioupload.py index aeb71000..902a162b 100644 --- a/platformio/builder/tools/pioupload.py +++ b/platformio/builder/tools/pioupload.py @@ -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. "