From 987710ac278e9232d4e7dcd3870699b4dd275187 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 8 Oct 2026 10:33:14 +0200 Subject: [PATCH] fix CUTOM board serial terminal issue --- src/core/system.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/system.cpp b/src/core/system.cpp index 3c65f7c82..ff9fa1e91 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -3767,9 +3767,14 @@ void System::remove_optional_gpio(uint8_t pin) { // set unused gpios to default state input high-Z void System::reset_unused_gpios() { +#if CONFIG_IDF_TARGET_ESP32 +constexpr uint8_t tx0 = 1; // don't change tx0 pin +#else +constexpr uint8_t tx0 = 255; // no valid pin, chips have native USB, tx0 not connected to transceiver +#endif for (const auto & pin : valid_system_gpios_) { auto it = std::find_if(used_gpios_.begin(), used_gpios_.end(), [pin](const GpioUsage & usage) { return usage.pin == pin; }); - if (it == used_gpios_.end()) { + if (it == used_gpios_.end() && pin != tx0) { LOG_DEBUG("reset pin %d", pin); pinMode(pin, INPUT); }