Add OS X specific delay after waiting for upload port, to prevent "Resource busy" errors on open

This commit is contained in:
Sandeep Mistry 2016-02-29 13:01:11 -05:00
parent de412656ec
commit 7a535d9c40
1 changed files with 6 additions and 0 deletions

View File

@ -136,6 +136,12 @@ public class SerialUploader extends Uploader {
// it happened within 250 ms. So we wait until the reset should
// have already occured before we start scanning.
actualUploadPort = waitForUploadPort(userSelectedUploadPort, before);
if (OSUtils.isMacOS()) {
// on OS X, if the port is opened too quickly after it is detected,
// a "Resource busy" error occurs, add a delay to workaround this
Thread.sleep(250);
}
}
} catch (SerialException e) {
throw new RunnerException(e);