Wait up to 2 seconds for port being connected.

This will send serial debug log from the beginning and not somewhere in between.
pull/1324/head
Thomas Göttgens 2022-03-25 23:06:31 +01:00 zatwierdzone przez GitHub
rodzic 501067cd36
commit 54d802f15d
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 10 dodań i 0 usunięć

Wyświetl plik

@ -28,6 +28,16 @@ SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port)
// setDestination(&noopPrint); for testing, try turning off 'all' debug output and see what leaks
Port.begin(SERIAL_BAUD);
#ifdef NRF52_SERIES
time_t timeout = millis();
while (!Port) {
if ((millis() - timeout) < 2000) {
delay(100);
} else {
break;
}
}
#endif
emitRebooted();
}