From 1ea17607f35e1a664e78e315fd8265435576bef6 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 25 Oct 2025 14:44:25 -0700 Subject: [PATCH] fix race. --- esphome/components/usb_uart/usb_uart.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esphome/components/usb_uart/usb_uart.cpp b/esphome/components/usb_uart/usb_uart.cpp index 5b085a9c0b..a97db9cefd 100644 --- a/esphome/components/usb_uart/usb_uart.cpp +++ b/esphome/components/usb_uart/usb_uart.cpp @@ -297,7 +297,8 @@ void USBUartComponent::start_input(USBUartChannel *channel) { // On success, reset retry count and restart input immediately from USB task for performance // The lock-free queue will handle backpressure channel->input_retry_count_.store(0); - this->restart_input_(channel); + channel->input_started_.store(false); + this->start_input(channel); }; // input_started_ already set to true by compare_exchange_strong above auto result = this->transfer_in(ep->bEndpointAddress, callback, ep->wMaxPacketSize);