File tree Expand file tree Collapse file tree 7 files changed +39
-7
lines changed Expand file tree Collapse file tree 7 files changed +39
-7
lines changed Original file line number Diff line number Diff line change 28
28
#include "hpl/pm/hpl_pm_base.h"
29
29
#include "hpl/gclk/hpl_gclk_base.h"
30
30
#include "hal_gpio.h"
31
+ #include "lib/tinyusb/src/device/usbd.h"
31
32
32
33
void init_usb_hardware (void ) {
33
34
#ifdef SAMD21
@@ -57,3 +58,27 @@ void init_usb_hardware(void) {
57
58
gpio_set_pin_function (PIN_PA25 , PINMUX_PA25H_USB_DP );
58
59
#endif
59
60
}
61
+
62
+ #ifdef SAMD21
63
+ void USB_Handler (void ) {
64
+ tud_int_handler (0 );
65
+ }
66
+ #endif
67
+
68
+ #ifdef SAMD51
69
+ void USB_0_Handler (void ) {
70
+ tud_int_handler (0 );
71
+ }
72
+
73
+ void USB_1_Handler (void ) {
74
+ tud_int_handler (0 );
75
+ }
76
+
77
+ void USB_2_Handler (void ) {
78
+ tud_int_handler (0 );
79
+ }
80
+
81
+ void USB_3_Handler (void ) {
82
+ tud_int_handler (0 );
83
+ }
84
+ #endif
Original file line number Diff line number Diff line change 37
37
#include "irq.h"
38
38
39
39
#ifdef CFG_TUSB_MCU
40
- void hal_dcd_isr (uint8_t rhport );
41
40
#endif
42
41
43
42
/*------------------------------------------------------------------*/
@@ -72,7 +71,7 @@ void isr(void) {
72
71
73
72
#ifdef CFG_TUSB_MCU
74
73
if (irqs & (1 << USB_INTERRUPT ))
75
- hal_dcd_isr (0 );
74
+ tud_int_handler (0 );
76
75
#endif
77
76
if (irqs & (1 << TIMER0_INTERRUPT ))
78
77
SysTick_Handler ();
Original file line number Diff line number Diff line change @@ -56,5 +56,5 @@ void init_usb_hardware(void) {
56
56
}
57
57
58
58
void USB_OTG1_IRQHandler (void ) {
59
- tud_isr (0 );
59
+ tud_int_handler (0 );
60
60
}
Original file line number Diff line number Diff line change @@ -87,3 +87,7 @@ void init_usb_hardware(void) {
87
87
}
88
88
}
89
89
}
90
+
91
+ void USBD_IRQHandler (void ) {
92
+ tud_int_handler (0 );
93
+ }
Original file line number Diff line number Diff line change @@ -63,13 +63,13 @@ STATIC void init_usb_vbus_sense(void) {
63
63
}
64
64
65
65
void init_usb_hardware (void ) {
66
- //TODO: if future chips overload this with options, move to peripherals management.
66
+ //TODO: if future chips overload this with options, move to peripherals management.
67
67
68
68
GPIO_InitTypeDef GPIO_InitStruct = {0 };
69
69
/**USB_OTG_FS GPIO Configuration
70
70
PA10 ------> USB_OTG_FS_ID
71
71
PA11 ------> USB_OTG_FS_DM
72
- PA12 ------> USB_OTG_FS_DP
72
+ PA12 ------> USB_OTG_FS_DP
73
73
*/
74
74
__HAL_RCC_GPIOA_CLK_ENABLE ();
75
75
@@ -129,3 +129,7 @@ void init_usb_hardware(void) {
129
129
130
130
init_usb_vbus_sense ();
131
131
}
132
+
133
+ void OTG_FS_IRQHandler (void ) {
134
+ tud_int_handler (0 );
135
+ }
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ uint8_t const * tud_hid_descriptor_report_cb(void) {
52
52
53
53
// Invoked when received GET STRING DESCRIPTOR request
54
54
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
55
- uint16_t const * tud_descriptor_string_cb (uint8_t index ) {
55
+ uint16_t const * tud_descriptor_string_cb (uint8_t index , uint16_t langid ) {
56
56
uint8_t const max_index = sizeof (string_desc_arr )/sizeof (string_desc_arr [0 ]);
57
57
return (index < max_index ) ? string_desc_arr [index ] : NULL ;
58
58
}
You can’t perform that action at this time.
0 commit comments