2026-10-08 10:05:56 +03:00
|
|
|
--- a/esphome/components/uart/uart_component_libretiny.cpp
|
|
|
|
|
+++ b/esphome/components/uart/uart_component_libretiny.cpp
|
2026-11-19 00:31:45 +01:00
|
|
|
@@ -74,7 +74,9 @@
|
2026-10-08 10:05:56 +03:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
#if LT_HW_UART0
|
|
|
|
|
- else if ((tx_pin == -1 || tx_pin == PIN_SERIAL0_TX) && (rx_pin == -1 || rx_pin == PIN_SERIAL0_RX) &&
|
|
|
|
|
+ else if ((((tx_pin == -1 || tx_pin == PIN_SERIAL0_TX) &&
|
|
|
|
|
+ (rx_pin == -1 || rx_pin == PIN_SERIAL0_RX)) ||
|
|
|
|
|
+ (tx_pin == 14 && rx_pin == 13)) &&
|
2026-11-19 00:31:45 +01:00
|
|
|
!should_fallback_to_software_serial()) {
|
2026-10-08 10:05:56 +03:00
|
|
|
this->serial_ = &Serial0;
|
|
|
|
|
this->hardware_idx_ = 0;
|
2026-11-19 00:31:45 +01:00
|
|
|
@@ -124,6 +126,10 @@
|
|
|
|
|
|
|
|
|
|
if (this->hardware_idx_ >= 0)
|
|
|
|
|
libretiny::ensure_serial_handle(this->hardware_idx_);
|
2026-10-08 10:05:56 +03:00
|
|
|
+ if (this->hardware_idx_ == 0 && tx_pin == 14 && rx_pin == 13) {
|
|
|
|
|
+ ESP_LOGI(TAG, "Using alternate UART0 pins RX=PA13 TX=PA14");
|
|
|
|
|
+ Serial0.setPins(rx_pin, tx_pin);
|
|
|
|
|
+ }
|
|
|
|
|
this->serial_->begin(this->baud_rate_, get_config());
|
|
|
|
|
}
|
2026-11-19 00:31:45 +01:00
|
|
|
|