From c18a0f538fbc3e9f0550ffaedcd04113aa348834 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 25 Oct 2025 15:05:13 -0700 Subject: [PATCH] preen --- esphome/components/usb_uart/usb_uart.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/esphome/components/usb_uart/usb_uart.cpp b/esphome/components/usb_uart/usb_uart.cpp index fa9b5a13b7..46bb5728a7 100644 --- a/esphome/components/usb_uart/usb_uart.cpp +++ b/esphome/components/usb_uart/usb_uart.cpp @@ -229,13 +229,12 @@ void USBUartComponent::do_start_input_(USBUartChannel *channel) { // Caller must ensure input_started_ is already set to true const auto *ep = channel->cdc_dev_.in_ep; - // Set up callback using a lambda that captures channel and forwards to the named function - auto callback = [this, channel](const usb_host::TransferStatus &status) { - this->input_transfer_callback_(channel, status); - }; - // input_started_ already set to true by caller - auto result = this->transfer_in(ep->bEndpointAddress, callback, ep->wMaxPacketSize); + auto result = this->transfer_in( + ep->bEndpointAddress, + [this, channel](const usb_host::TransferStatus &status) { this->input_transfer_callback_(channel, status); }, + ep->wMaxPacketSize); + if (result == usb_host::TRANSFER_ERROR_NO_SLOTS) { // No slots available - defer retry to main loop this->defer_input_retry_(channel);