Update TinyUSB and add interrupt hooks.
This commit is contained in:
parent
1a71c8c515
commit
7e3d4c61b5
@ -1 +1 @@
|
||||
Subproject commit 1f95f439e11f519e69d75a4a8b7b9f28eaf5060e
|
||||
Subproject commit 3ed9515e70b0c6bc375cd058dcc6b8b78b00899a
|
@ -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
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include "irq.h"
|
||||
|
||||
#ifdef CFG_TUSB_MCU
|
||||
void hal_dcd_isr(uint8_t rhport);
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
@ -72,7 +71,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();
|
||||
|
@ -56,5 +56,5 @@ void init_usb_hardware(void) {
|
||||
}
|
||||
|
||||
void USB_OTG1_IRQHandler(void) {
|
||||
tud_isr(0);
|
||||
tud_int_handler(0);
|
||||
}
|
||||
|
@ -87,3 +87,7 @@ void init_usb_hardware(void) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void USBD_IRQHandler(void) {
|
||||
tud_int_handler(0);
|
||||
}
|
||||
|
@ -63,13 +63,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 +129,7 @@ void init_usb_hardware(void) {
|
||||
|
||||
init_usb_vbus_sense();
|
||||
}
|
||||
|
||||
void OTG_FS_IRQHandler(void) {
|
||||
tud_int_handler(0);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user