Skip to content

Commit a45b5c5

Browse files
authored
Merge pull request #221 from hathach/update-tinyusb
update tinyusb core and samd port
2 parents 6c2a982 + 72ebc1a commit a45b5c5

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

cores/arduino/TinyUSB/Adafruit_TinyUSB_SAMD.cpp

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,27 @@
2828
#include "Adafruit_TinyUSB_Core.h"
2929
#include <Reset.h> // Needed for auto-reset with 1200bps port touch
3030

31+
//--------------------------------------------------------------------+
32+
// Forward USB interrupt events to TinyUSB IRQ Handler
33+
//--------------------------------------------------------------------+
34+
extern "C"
35+
{
36+
#if defined(__SAMD51__)
37+
38+
void USB_0_Handler (void) { tud_int_handler(0); }
39+
void USB_1_Handler (void) { tud_int_handler(0); }
40+
void USB_2_Handler (void) { tud_int_handler(0); }
41+
void USB_3_Handler (void) { tud_int_handler(0); }
42+
43+
#else
44+
45+
void USBD_IRQHandler(void) { tud_int_handler(0); }
46+
47+
#endif
48+
} // extern C
49+
50+
51+
3152
//--------------------------------------------------------------------+
3253
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
3354
//--------------------------------------------------------------------+
@@ -74,15 +95,6 @@ void Adafruit_TinyUSB_Core_touch1200(void)
7495
//--------------------------------------------------------------------+
7596
// Adafruit_USBD_Device platform dependent
7697
//--------------------------------------------------------------------+
77-
void Adafruit_USBD_Device::detach(void)
78-
{
79-
USB->DEVICE.CTRLB.reg |= USB_DEVICE_CTRLB_DETACH;
80-
}
81-
82-
void Adafruit_USBD_Device::attach(void)
83-
{
84-
USB->DEVICE.CTRLB.reg &= ~USB_DEVICE_CTRLB_DETACH;
85-
}
8698

8799
uint8_t Adafruit_USBD_Device::getSerialDescriptor(uint16_t* serial_str)
88100
{

0 commit comments

Comments
 (0)