Skip to content

Commit 5a69e51

Browse files
sandeepmistryfacchinm
authored andcommitted
Add OS X specific delay after waiting for upload port, to prevent "Resource busy" errors on open
1 parent 09fbef6 commit 5a69e51

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arduino-core/src/cc/arduino/packages/uploaders/SerialUploader.java

+6
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ public boolean uploadUsingPreferences(File sourcePath, String buildPath, String
144144
// it happened within 250 ms. So we wait until the reset should
145145
// have already occurred before we start scanning.
146146
actualUploadPort = waitForUploadPort(userSelectedUploadPort, before);
147+
148+
if (OSUtils.isMacOS()) {
149+
// on OS X, if the port is opened too quickly after it is detected,
150+
// a "Resource busy" error occurs, add a delay to workaround this
151+
Thread.sleep(250);
152+
}
147153
}
148154
} catch (SerialException e) {
149155
throw new RunnerException(e);

0 commit comments

Comments
 (0)