Skip to content

Commit 7a535d9

Browse files
committed
Add OS X specific delay after waiting for upload port, to prevent "Resource busy" errors on open
1 parent de41265 commit 7a535d9

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
@@ -136,6 +136,12 @@ public boolean uploadUsingPreferences(File sourcePath, String buildPath, String
136136
// it happened within 250 ms. So we wait until the reset should
137137
// have already occured before we start scanning.
138138
actualUploadPort = waitForUploadPort(userSelectedUploadPort, before);
139+
140+
if (OSUtils.isMacOS()) {
141+
// on OS X, if the port is opened too quickly after it is detected,
142+
// a "Resource busy" error occurs, add a delay to workaround this
143+
Thread.sleep(250);
144+
}
139145
}
140146
} catch (SerialException e) {
141147
throw new RunnerException(e);

0 commit comments

Comments
 (0)