mirror of
https://github.com/esphome/esphome.git
synced 2025-09-26 07:02:21 +01:00
simplify
This commit is contained in:
@@ -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 {
|
||||
|
@@ -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");
|
||||
|
Reference in New Issue
Block a user