1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-22 08:22:04 +03:00

Upload over debug port (part 2)

This commit is contained in:
Cristian Maglie
2012-09-08 00:55:37 +02:00
parent ca74c94ae5
commit d96264e60f
5 changed files with 117 additions and 35 deletions

View File

@ -91,7 +91,7 @@ public class BasicUploader extends Uploader {
uploadPort = waitForUploadPort(uploadPort, before);
} else {
Thread.sleep(2500);
Thread.sleep(1000);
}
} catch (SerialException e) {
throw new RunnerException(e.getMessage());
@ -136,8 +136,13 @@ public class BasicUploader extends Uploader {
long timeout = System.currentTimeMillis() + 2000;
while (timeout > System.currentTimeMillis()) {
List<String> portList = Serial.list();
if (portList.contains(Preferences.get("serial.port")))
String uploadPort = Preferences.get("serial.port");
if (portList.contains(Preferences.get("serial.port"))) {
// Remove the magic baud rate (1200bps) to avoid
// future unwanted board resets
Serial.touchPort(uploadPort, 9600);
break;
}
Thread.sleep(100);
}
}