From e325872f4e3672a40e6d8683a6995d5aa9d28c02 Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Sat, 18 Jul 2020 17:52:06 +0300 Subject: [PATCH] Update USB.cpp --- libraries/USB/src/USB.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libraries/USB/src/USB.cpp b/libraries/USB/src/USB.cpp index 629947a6..a5815eeb 100644 --- a/libraries/USB/src/USB.cpp +++ b/libraries/USB/src/USB.cpp @@ -115,16 +115,6 @@ ESPUSB::ESPUSB(size_t task_stack_size, uint8_t event_task_priority) ,_task_stack_size(task_stack_size) ,_event_task_priority(event_task_priority) { -} - -ESPUSB::~ESPUSB(){ - if (arduino_usb_event_loop_handle) { - esp_event_loop_delete(arduino_usb_event_loop_handle); - arduino_usb_event_loop_handle = NULL; - } -} - -bool ESPUSB::begin(){ if (!arduino_usb_event_loop_handle) { esp_event_loop_args_t event_task_args = { .queue_size = 5, @@ -137,6 +127,16 @@ bool ESPUSB::begin(){ log_e("esp_event_loop_create failed"); } } +} + +ESPUSB::~ESPUSB(){ + if (arduino_usb_event_loop_handle) { + esp_event_loop_delete(arduino_usb_event_loop_handle); + arduino_usb_event_loop_handle = NULL; + } +} + +bool ESPUSB::begin(){ if(!_started){ tinyusb_device_config_t tinyusb_device_config = { .vid = vid,