Refactor SerialConsole to simplify timeout handling (#10802)
Removed conditional compilation for timeout check on supported architectures.
This commit is contained in:
@@ -65,8 +65,6 @@ SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port), con
|
|||||||
Port.setRX(SERIAL2_RX);
|
Port.setRX(SERIAL2_RX);
|
||||||
#endif
|
#endif
|
||||||
Port.begin(SERIAL_BAUD);
|
Port.begin(SERIAL_BAUD);
|
||||||
#if defined(ARCH_NRF52) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(ARCH_RP2040) || \
|
|
||||||
defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6)
|
|
||||||
time_t timeout = millis();
|
time_t timeout = millis();
|
||||||
while (!Port) {
|
while (!Port) {
|
||||||
if (Throttle::isWithinTimespanMs(timeout, FIVE_SECONDS_MS)) {
|
if (Throttle::isWithinTimespanMs(timeout, FIVE_SECONDS_MS)) {
|
||||||
@@ -75,7 +73,6 @@ SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port), con
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#if !ARCH_PORTDUINO
|
#if !ARCH_PORTDUINO
|
||||||
emitRebooted();
|
emitRebooted();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user