Skip to content

Commit a755dd7

Browse files
author
Federico Fissore
committed
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
1 parent 2f4485d commit a755dd7

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Diff for: arduino-core/src/cc/arduino/packages/discoverers/serial/SerialBoardsLister.java

+2-6
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141

4242
public class SerialBoardsLister extends TimerTask {
4343

44-
private static final int MAX_TIME_AWAITING_FOR_PACKAGES = 5000;
45-
4644
private final SerialDiscovery serialDiscovery;
4745

4846
public SerialBoardsLister(SerialDiscovery serialDiscovery) {
@@ -55,13 +53,11 @@ public void start(Timer timer) {
5553

5654
@Override
5755
public void run() {
58-
int sleptFor = 0;
59-
while (BaseNoGui.packages == null && sleptFor <= MAX_TIME_AWAITING_FOR_PACKAGES) {
56+
while (BaseNoGui.packages == null) {
6057
try {
6158
Thread.sleep(1000);
62-
sleptFor += 1000;
6359
} catch (InterruptedException e) {
64-
e.printStackTrace();
60+
// noop
6561
}
6662
}
6763

0 commit comments

Comments
 (0)