Increase wait for upload port timeout to 5s on all platforms

OS X 10.11 seems to be slower, increasing timeout to 5s on all
platforms to keep things simple.
This commit is contained in:
Sandeep Mistry 2016-02-01 15:53:09 -05:00
parent 26e25a4d58
commit de412656ec
1 changed files with 4 additions and 5 deletions

View File

@ -247,11 +247,10 @@ public class SerialUploader extends Uploader {
Thread.sleep(250);
elapsed += 250;
// On Windows, it can take a long time for the port to disappear and
// come back, so use a longer time out before assuming that the
// selected
// port is the bootloader (not the sketch).
if (((!OSUtils.isWindows() && elapsed >= 500) || elapsed >= 5000) && now.contains(uploadPort)) {
// On Windows and OS X, it can take a few seconds for the port to disappear and
// come back, so use a time out before assuming that the selected port is the
// bootloader (not the sketch).
if (elapsed >= 5000 && now.contains(uploadPort)) {
if (verbose)
System.out.println("Uploading using selected port: " + uploadPort);
return uploadPort;