1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-21 10:52:14 +01:00

Wait a bit before resuming serial monitor

Helps in case the bootloader port has not yet disappeared when upload completes successfully.
This commit is contained in:
Martino Facchin 2020-03-10 18:39:28 +01:00 committed by Cristian Maglie
parent d154120f0e
commit bb629d1ba0

View File

@ -2091,6 +2091,11 @@ public class Editor extends JFrame implements RunnerListener {
private void resumeOrCloseSerialMonitor() {
// Return the serial monitor window to its initial state
if (serialMonitor != null) {
try {
Thread.sleep(200);
} catch (InterruptedException e) {
// noop
}
BoardPort boardPort = BaseNoGui.getDiscoveryManager().find(PreferencesData.get("serial.port"));
long sleptFor = 0;
while (boardPort == null && sleptFor < MAX_TIME_AWAITING_FOR_RESUMING_SERIAL_MONITOR) {