mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-17 06:52:18 +01:00
Changes in upload procedure (WIP)
This commit is contained in:
parent
60f8e10bf9
commit
507921fd0f
@ -99,8 +99,8 @@ public class AvrdudeUploader extends Uploader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Wait for a port to appear on the list
|
// Wait for a port to appear on the list
|
||||||
long timeout = System.currentTimeMillis() + 10000;
|
int elapsed = 0;
|
||||||
while (System.currentTimeMillis() < timeout) {
|
while (elapsed < 20000) {
|
||||||
List<String> now = Serial.list();
|
List<String> now = Serial.list();
|
||||||
List<String> diff = new ArrayList<String>(now);
|
List<String> diff = new ArrayList<String>(now);
|
||||||
diff.removeAll(before);
|
diff.removeAll(before);
|
||||||
@ -123,6 +123,16 @@ public class AvrdudeUploader extends Uploader {
|
|||||||
// Keep track of port that disappears
|
// Keep track of port that disappears
|
||||||
before = now;
|
before = now;
|
||||||
Thread.sleep(500);
|
Thread.sleep(500);
|
||||||
|
elapsed += 500;
|
||||||
|
|
||||||
|
// If after 4 seconds the selected port is active use that port
|
||||||
|
if (elapsed == 4000) {
|
||||||
|
System.out.println("using selected port: " + uploadPort);
|
||||||
|
if (now.contains(uploadPort)) {
|
||||||
|
caterinaUploadPort = uploadPort;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (caterinaUploadPort == null)
|
if (caterinaUploadPort == null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user