mirror of https://github.com/noisymime/Arduino.git
SerialBoardsLister now waits indefinitely before starting. BaseNoGui.packages
will eventually be set to at least an empty HashMap, even if no hardware is present. Fixes #3311
This commit is contained in:
parent
2f4485d06b
commit
a755dd7694
|
@ -41,8 +41,6 @@ import java.util.*;
|
|||
|
||||
public class SerialBoardsLister extends TimerTask {
|
||||
|
||||
private static final int MAX_TIME_AWAITING_FOR_PACKAGES = 5000;
|
||||
|
||||
private final SerialDiscovery serialDiscovery;
|
||||
|
||||
public SerialBoardsLister(SerialDiscovery serialDiscovery) {
|
||||
|
@ -55,13 +53,11 @@ public class SerialBoardsLister extends TimerTask {
|
|||
|
||||
@Override
|
||||
public void run() {
|
||||
int sleptFor = 0;
|
||||
while (BaseNoGui.packages == null && sleptFor <= MAX_TIME_AWAITING_FOR_PACKAGES) {
|
||||
while (BaseNoGui.packages == null) {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
sleptFor += 1000;
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
// noop
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue