Skip to content

Commit 8459065

Browse files
committed
Changes as discussed in #209
1 parent 4f815d1 commit 8459065

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

it.baeyens.arduino.core/src/it/baeyens/arduino/communication/ArduinoSerial.java

+9-7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import org.eclipse.core.resources.IProject;
1515
import org.eclipse.core.runtime.IStatus;
16+
import org.eclipse.core.runtime.Platform;
1617
import org.eclipse.core.runtime.Status;
1718
import org.eclipse.ui.console.MessageConsoleStream;
1819

@@ -35,11 +36,12 @@ public static boolean reset_Arduino_by_baud_rate(String ComPort, int baudrate, l
3536
Common.log(new Status(IStatus.WARNING, ArduinoConst.CORE_PLUGIN_ID, "Unable to open Serial port " + ComPort, e));
3637
return false;
3738
}
38-
39-
try {
40-
Thread.sleep(openTime); // FIXME this should NOT be done on MacOS
41-
} catch (InterruptedException e) {// Jaba is not going to write this
42-
// code
39+
if (!Platform.getOS().equals(Platform.OS_MACOSX)) {
40+
try {
41+
Thread.sleep(openTime);
42+
} catch (InterruptedException e) {// Jaba is not going to write this
43+
// code
44+
}
4345
}
4446
serialPort.dispose();
4547
return true;
@@ -59,9 +61,9 @@ public static String wait_for_com_Port_to_appear(MessageConsoleStream console, V
5961
Vector<String> NewPorts;
6062
Vector<String> NewPortsCopy;
6163

62-
// wait for port to disappear
64+
// wait for port to disappear and appear
6365
int NumTries = 0;
64-
int MaxTries = 20; // wait for max 5 seconds, leaves us 3 secs in case we are not seeing disappearing ports but reset worked
66+
int MaxTries = 40; // wait for max 10 seconds as arduino does
6567
int delayMs = 250;
6668
do {
6769

0 commit comments

Comments
 (0)