Skip to content

Commit cfc7405

Browse files
committed
move thing around
1 parent 581fff6 commit cfc7405

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

src/arduino/ports/esp32/Adafruit_TinyUSB_esp32.cpp

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -69,25 +69,7 @@
6969
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
7070
//--------------------------------------------------------------------+
7171

72-
#define USBD_STACK_SZ (4096)
73-
74-
//--------------------------------------------------------------------+
75-
// Forward USB interrupt events to TinyUSB IRQ Handler
76-
//--------------------------------------------------------------------+
77-
// extern "C" void USBD_IRQHandler(void) {
78-
// tud_int_handler(0);
79-
//}
80-
81-
//--------------------------------------------------------------------+
82-
// Porting API
83-
//--------------------------------------------------------------------+
84-
85-
// USB Device Driver task
86-
// This top level thread processes all usb events and invokes callbacks
87-
static void usb_device_task(void *param) {
88-
(void)param;
89-
while(1) tud_task(); // RTOS forever loop
90-
}
72+
// Note: persist mode is mostly copied from esp32-hal-tinyusb.c from arduino-esp32 core.
9173

9274
typedef enum {
9375
RESTART_NO_PERSIST,
@@ -150,6 +132,19 @@ static void configure_pins(usb_hal_context_t *usb)
150132
}
151133
}
152134

135+
//--------------------------------------------------------------------+
136+
// Porting API
137+
//--------------------------------------------------------------------+
138+
139+
#define USBD_STACK_SZ (4096)
140+
141+
// USB Device Driver task
142+
// This top level thread processes all usb events and invokes callbacks
143+
static void usb_device_task(void *param) {
144+
(void)param;
145+
while(1) tud_task(); // RTOS forever loop
146+
}
147+
153148
void TinyUSB_Port_InitDevice(uint8_t rhport) {
154149
(void)rhport;
155150

0 commit comments

Comments
 (0)