File tree Expand file tree Collapse file tree 7 files changed +42
-10
lines changed Expand file tree Collapse file tree 7 files changed +42
-10
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 27
27
28
28
#include <string.h>
29
29
30
+ #include "lib/tinyusb/src/device/usbd.h"
30
31
#include "py/mphal.h"
31
32
#include "py/mpstate.h"
32
33
#include "py/gc.h"
36
37
37
38
#include "irq.h"
38
39
39
- #ifdef CFG_TUSB_MCU
40
- void hal_dcd_isr (uint8_t rhport );
41
- #endif
42
-
43
40
/*------------------------------------------------------------------*/
44
41
/* delay
45
42
*------------------------------------------------------------------*/
@@ -72,7 +69,7 @@ void isr(void) {
72
69
73
70
#ifdef CFG_TUSB_MCU
74
71
if (irqs & (1 << USB_INTERRUPT ))
75
- hal_dcd_isr (0 );
72
+ tud_int_handler (0 );
76
73
#endif
77
74
if (irqs & (1 << TIMER0_INTERRUPT ))
78
75
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 30
30
#include "supervisor/usb.h"
31
31
#include "lib/utils/interrupt_char.h"
32
32
#include "lib/mp-readline/readline.h"
33
+ #include "lib/tinyusb/src/device/usbd.h"
33
34
34
35
#ifdef SOFTDEVICE_PRESENT
35
36
#include "nrf_sdm.h"
@@ -87,3 +88,7 @@ void init_usb_hardware(void) {
87
88
}
88
89
}
89
90
}
91
+
92
+ void USBD_IRQHandler (void ) {
93
+ tud_int_handler (0 );
94
+ }
Original file line number Diff line number Diff line change 30
30
#include "supervisor/usb.h"
31
31
#include "lib/utils/interrupt_char.h"
32
32
#include "lib/mp-readline/readline.h"
33
+ #include "lib/tinyusb/src/device/usbd.h"
33
34
34
35
#include "py/mpconfig.h"
35
36
@@ -63,13 +64,13 @@ STATIC void init_usb_vbus_sense(void) {
63
64
}
64
65
65
66
void init_usb_hardware (void ) {
66
- //TODO: if future chips overload this with options, move to peripherals management.
67
+ //TODO: if future chips overload this with options, move to peripherals management.
67
68
68
69
GPIO_InitTypeDef GPIO_InitStruct = {0 };
69
70
/**USB_OTG_FS GPIO Configuration
70
71
PA10 ------> USB_OTG_FS_ID
71
72
PA11 ------> USB_OTG_FS_DM
72
- PA12 ------> USB_OTG_FS_DP
73
+ PA12 ------> USB_OTG_FS_DP
73
74
*/
74
75
__HAL_RCC_GPIOA_CLK_ENABLE ();
75
76
@@ -129,3 +130,7 @@ void init_usb_hardware(void) {
129
130
130
131
init_usb_vbus_sense ();
131
132
}
133
+
134
+ void OTG_FS_IRQHandler (void ) {
135
+ tud_int_handler (0 );
136
+ }
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