mirror of
https://github.com/esphome/esphome.git
synced 2025-09-26 23:22: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 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_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 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
|
// used to report a transfer status
|
||||||
struct TransferStatus {
|
struct TransferStatus {
|
||||||
|
@@ -191,13 +191,11 @@ void USBClient::setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create and start USB task
|
// Create and start USB task
|
||||||
xTaskCreatePinnedToCore(usb_task_fn, "usb_task",
|
xTaskCreate(usb_task_fn, "usb_task",
|
||||||
USB_TASK_STACK_SIZE, // Stack size
|
USB_TASK_STACK_SIZE, // Stack size
|
||||||
this, // Task parameter
|
this, // Task parameter
|
||||||
5, // Priority (higher than main loop)
|
USB_TASK_PRIORITY, // Priority (higher than main loop)
|
||||||
&this->usb_task_handle_,
|
&this->usb_task_handle_);
|
||||||
1 // Core 1
|
|
||||||
);
|
|
||||||
|
|
||||||
if (this->usb_task_handle_ == nullptr) {
|
if (this->usb_task_handle_ == nullptr) {
|
||||||
ESP_LOGE(TAG, "Failed to create USB task");
|
ESP_LOGE(TAG, "Failed to create USB task");
|
||||||
|
Reference in New Issue
Block a user