From d3b4b11302350f9ba7adabef7cc889088e3e30dd Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 25 Oct 2025 13:50:16 -0700 Subject: [PATCH] narrow scope --- esphome/components/usb_uart/usb_uart.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esphome/components/usb_uart/usb_uart.cpp b/esphome/components/usb_uart/usb_uart.cpp index c41c249f5d..9b049f05ed 100644 --- a/esphome/components/usb_uart/usb_uart.cpp +++ b/esphome/components/usb_uart/usb_uart.cpp @@ -256,8 +256,8 @@ void USBUartComponent::start_input(USBUartChannel *channel) { ESP_LOGV(TAG, "Transfer result: length: %u; status %X", status.data_len, status.error_code); if (!status.success) { ESP_LOGE(TAG, "Control transfer failed, status=%s", esp_err_to_name(status.error_code)); - // On failure, defer retry to main loop - this->defer_input_retry_(channel); + // Transfer failed, slot already released - just clear flag, let read_array() restart later + channel->input_started_.store(false); return; } @@ -265,9 +265,9 @@ void USBUartComponent::start_input(USBUartChannel *channel) { // Allocate a chunk from the pool UsbDataChunk *chunk = this->chunk_pool_.allocate(); if (chunk == nullptr) { - // No chunks available - defer retry to main loop for backpressure + // No chunks available - queue is full, data dropped, slot already released this->usb_data_queue_.increment_dropped_count(); - this->defer_input_retry_(channel); + channel->input_started_.store(false); return; }