1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-26 07:02:21 +01:00
This commit is contained in:
J. Nick Koston
2025-09-23 23:03:25 -05:00
parent af031530ce
commit dca79872bf
2 changed files with 6 additions and 7 deletions

View File

@@ -35,6 +35,7 @@ static const size_t SETUP_PACKET_SIZE = 8;
static const size_t MAX_REQUESTS = 16; // maximum number of outstanding requests possible.
static constexpr size_t USB_EVENT_QUEUE_SIZE = 32; // Size of event queue between USB task and main loop
static constexpr size_t USB_TASK_STACK_SIZE = 4096; // Stack size for USB task (same as ESP-IDF USB examples)
static constexpr UBaseType_t USB_TASK_PRIORITY = 5; // Higher priority than main loop (tskIDLE_PRIORITY + 5)
// used to report a transfer status
struct TransferStatus {

View File

@@ -191,13 +191,11 @@ void USBClient::setup() {
}
// Create and start USB task
xTaskCreatePinnedToCore(usb_task_fn, "usb_task",
USB_TASK_STACK_SIZE, // Stack size
this, // Task parameter
5, // Priority (higher than main loop)
&this->usb_task_handle_,
1 // Core 1
);
xTaskCreate(usb_task_fn, "usb_task",
USB_TASK_STACK_SIZE, // Stack size
this, // Task parameter
USB_TASK_PRIORITY, // Priority (higher than main loop)
&this->usb_task_handle_);
if (this->usb_task_handle_ == nullptr) {
ESP_LOGE(TAG, "Failed to create USB task");