diff --git a/esphome/components/usb_uart/usb_uart.cpp b/esphome/components/usb_uart/usb_uart.cpp index c41c249f5d..7df74072bb 100644 --- a/esphome/components/usb_uart/usb_uart.cpp +++ b/esphome/components/usb_uart/usb_uart.cpp @@ -256,8 +256,9 @@ 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 + // Mark input as not started so normal operations can restart later + channel->input_started_.store(false); return; } @@ -265,9 +266,10 @@ 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); + // Mark input as not started so normal operations can restart later + channel->input_started_.store(false); return; }