From c08c0c111a3cc7ba5ddf456a25708a1dee205378 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 23 Sep 2025 21:56:22 -0500 Subject: [PATCH] fix --- esphome/components/usb_host/usb_host.h | 1 - esphome/components/usb_host/usb_host_client.cpp | 3 --- 2 files changed, 4 deletions(-) diff --git a/esphome/components/usb_host/usb_host.h b/esphome/components/usb_host/usb_host.h index 3625100e4a..99b8437421 100644 --- a/esphome/components/usb_host/usb_host.h +++ b/esphome/components/usb_host/usb_host.h @@ -75,7 +75,6 @@ struct UsbEvent { } device_gone; struct { TransferRequest *trq; - bool callback_executed; // Flag to indicate callback was already executed in USB task } transfer; } data; }; diff --git a/esphome/components/usb_host/usb_host_client.cpp b/esphome/components/usb_host/usb_host_client.cpp index f9ecc89efa..d294520568 100644 --- a/esphome/components/usb_host/usb_host_client.cpp +++ b/esphome/components/usb_host/usb_host_client.cpp @@ -212,9 +212,7 @@ void USBClient::usb_task_fn(void *arg) { void USBClient::usb_task_loop() { ESP_LOGI(TAG, "USB task started on core %d", xPortGetCoreID()); - // Run forever - ESPHome reboots rather than shutting down cleanly while (true) { - // Handle USB events with a timeout to prevent blocking forever usb_host_client_handle_events(this->handle_, pdMS_TO_TICKS(10)); } } @@ -327,7 +325,6 @@ static void control_callback(const usb_transfer_t *xfer) { UsbEvent event; event.type = EVENT_CONTROL_COMPLETE; event.data.transfer.trq = trq; - event.data.transfer.callback_executed = true; xQueueSend(trq->client->get_event_queue(), &event, portMAX_DELAY); }