1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-18 12:54:25 +01:00

Lowering non-Windows timeout for assuming Leonardo has reset.

On Mac and Linux, the serial port should disappear fairly quickly.  So
if we see the selected port after 500 ms, it should be the bootloader
(not the sketch still).
This commit is contained in:
David A. Mellis 2012-03-04 19:38:53 -05:00
parent 4ab241ceb6
commit eda8f1301f

View File

@ -125,8 +125,10 @@ public class AvrdudeUploader extends Uploader {
Thread.sleep(250);
elapsed += 250;
// If after 5 seconds the selected port is active use that port
if (elapsed == 5000 && now.contains(uploadPort)) {
// 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 (((!Base.isWindows() && elapsed >= 500) || elapsed >= 5000) && now.contains(uploadPort)) {
System.out.println("using selected port: " + uploadPort);
caterinaUploadPort = uploadPort;
break;