diff options
| author | Scott Shawcroft <scott@adafruit.com> | 2020-04-26 20:55:36 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-26 20:55:36 -0700 |
| commit | 9e4b94f4662b6dd21d39e9fb75cf9745b0db055e (patch) | |
| tree | e66a8a0ce25482a6df673923e536fdfb1ae9db51 | |
| parent | 652a5de2425849fe3a23442bbaa36445cd55ec3e (diff) | |
| parent | 67c053e9c40f2831e7729791a72aa55f6637dde6 (diff) | |
Merge pull request #2805 from tannewt/update_tinyusb
Update tinyusb
| m--------- | lib/tinyusb | 0 | ||||
| -rw-r--r-- | ports/atmel-samd/supervisor/usb.c | 25 | ||||
| -rw-r--r-- | ports/litex/mphalport.c | 7 | ||||
| -rw-r--r-- | ports/mimxrt10xx/supervisor/usb.c | 2 | ||||
| -rw-r--r-- | ports/nrf/supervisor/usb.c | 5 | ||||
| -rw-r--r-- | ports/stm/supervisor/usb.c | 9 | ||||
| -rw-r--r-- | supervisor/shared/usb/usb_desc.c | 2 |
7 files changed, 41 insertions, 9 deletions
diff --git a/lib/tinyusb b/lib/tinyusb -Subproject 1f95f439e11f519e69d75a4a8b7b9f28eaf5060 +Subproject c59fa774274b13790a3ae0fc19d9651eeba560a diff --git a/ports/atmel-samd/supervisor/usb.c b/ports/atmel-samd/supervisor/usb.c index d13ca0ef1..b8a94790d 100644 --- a/ports/atmel-samd/supervisor/usb.c +++ b/ports/atmel-samd/supervisor/usb.c @@ -28,6 +28,7 @@ #include "hpl/pm/hpl_pm_base.h" #include "hpl/gclk/hpl_gclk_base.h" #include "hal_gpio.h" +#include "lib/tinyusb/src/device/usbd.h" void init_usb_hardware(void) { #ifdef SAMD21 @@ -57,3 +58,27 @@ void init_usb_hardware(void) { gpio_set_pin_function(PIN_PA25, PINMUX_PA25H_USB_DP); #endif } + +#ifdef SAMD21 +void USB_Handler(void) { + tud_int_handler(0); +} +#endif + +#ifdef SAMD51 +void USB_0_Handler (void) { + tud_int_handler(0); +} + +void USB_1_Handler (void) { + tud_int_handler(0); +} + +void USB_2_Handler (void) { + tud_int_handler(0); +} + +void USB_3_Handler (void) { + tud_int_handler(0); +} +#endif diff --git a/ports/litex/mphalport.c b/ports/litex/mphalport.c index 0b8f01298..689487791 100644 --- a/ports/litex/mphalport.c +++ b/ports/litex/mphalport.c @@ -27,6 +27,7 @@ #include <string.h> +#include "lib/tinyusb/src/device/usbd.h" #include "py/mphal.h" #include "py/mpstate.h" #include "py/gc.h" @@ -36,10 +37,6 @@ #include "irq.h" -#ifdef CFG_TUSB_MCU - void hal_dcd_isr(uint8_t rhport); -#endif - /*------------------------------------------------------------------*/ /* delay *------------------------------------------------------------------*/ @@ -72,7 +69,7 @@ void isr(void) { #ifdef CFG_TUSB_MCU if (irqs & (1 << USB_INTERRUPT)) - hal_dcd_isr(0); + tud_int_handler(0); #endif if (irqs & (1 << TIMER0_INTERRUPT)) SysTick_Handler(); diff --git a/ports/mimxrt10xx/supervisor/usb.c b/ports/mimxrt10xx/supervisor/usb.c index 051fcca9d..1bc7ea9b5 100644 --- a/ports/mimxrt10xx/supervisor/usb.c +++ b/ports/mimxrt10xx/supervisor/usb.c @@ -56,5 +56,5 @@ void init_usb_hardware(void) { } void USB_OTG1_IRQHandler(void) { - tud_isr(0); + tud_int_handler(0); } diff --git a/ports/nrf/supervisor/usb.c b/ports/nrf/supervisor/usb.c index bb9d78101..11a5a1561 100644 --- a/ports/nrf/supervisor/usb.c +++ b/ports/nrf/supervisor/usb.c @@ -30,6 +30,7 @@ #include "supervisor/usb.h" #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" +#include "lib/tinyusb/src/device/usbd.h" #ifdef SOFTDEVICE_PRESENT #include "nrf_sdm.h" @@ -87,3 +88,7 @@ void init_usb_hardware(void) { } } } + +void USBD_IRQHandler(void) { + tud_int_handler(0); +} diff --git a/ports/stm/supervisor/usb.c b/ports/stm/supervisor/usb.c index b66107b7b..b2f3ad86b 100644 --- a/ports/stm/supervisor/usb.c +++ b/ports/stm/supervisor/usb.c @@ -30,6 +30,7 @@ #include "supervisor/usb.h" #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" +#include "lib/tinyusb/src/device/usbd.h" #include "py/mpconfig.h" @@ -63,13 +64,13 @@ STATIC void init_usb_vbus_sense(void) { } void init_usb_hardware(void) { - //TODO: if future chips overload this with options, move to peripherals management. + //TODO: if future chips overload this with options, move to peripherals management. GPIO_InitTypeDef GPIO_InitStruct = {0}; /**USB_OTG_FS GPIO Configuration PA10 ------> USB_OTG_FS_ID PA11 ------> USB_OTG_FS_DM - PA12 ------> USB_OTG_FS_DP + PA12 ------> USB_OTG_FS_DP */ __HAL_RCC_GPIOA_CLK_ENABLE(); @@ -129,3 +130,7 @@ void init_usb_hardware(void) { init_usb_vbus_sense(); } + +void OTG_FS_IRQHandler(void) { + tud_int_handler(0); +} diff --git a/supervisor/shared/usb/usb_desc.c b/supervisor/shared/usb/usb_desc.c index 9b333d6fe..080187ebc 100644 --- a/supervisor/shared/usb/usb_desc.c +++ b/supervisor/shared/usb/usb_desc.c @@ -52,7 +52,7 @@ uint8_t const * tud_hid_descriptor_report_cb(void) { // Invoked when received GET STRING DESCRIPTOR request // Application return pointer to descriptor, whose contents must exist long enough for transfer to complete -uint16_t const* tud_descriptor_string_cb(uint8_t index) { +uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid) { uint8_t const max_index = sizeof(string_desc_arr)/sizeof(string_desc_arr[0]); return (index < max_index) ? string_desc_arr[index] : NULL; } |
