ports: Update to build with new tinyusb.
Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
9b7d8b87ee
commit
035d16126a
|
@ -90,11 +90,11 @@ void SysTick_Handler(void) {
|
|||
}
|
||||
|
||||
void USB_OTG1_IRQHandler(void) {
|
||||
tud_isr(0);
|
||||
tud_int_handler(0);
|
||||
tud_task();
|
||||
}
|
||||
|
||||
void USB_OTG2_IRQHandler(void) {
|
||||
tud_isr(1);
|
||||
tud_int_handler(1);
|
||||
tud_task();
|
||||
}
|
||||
|
|
|
@ -32,6 +32,5 @@
|
|||
#define CFG_TUD_CDC (1)
|
||||
#define CFG_TUD_CDC_RX_BUFSIZE (512)
|
||||
#define CFG_TUD_CDC_TX_BUFSIZE (512)
|
||||
#define CFG_TUD_CDC_EPSIZE (512)
|
||||
|
||||
#endif // MICROPY_INCLUDED_MIMXRT_TUSB_CONFIG_H
|
||||
|
|
|
@ -67,7 +67,7 @@ static const tusb_desc_device_t usbd_desc_device = {
|
|||
};
|
||||
|
||||
static const uint8_t usbd_desc_cfg[USBD_DESC_LEN] = {
|
||||
TUD_CONFIG_DESCRIPTOR(USBD_ITF_MAX, USBD_STR_0, USBD_DESC_LEN,
|
||||
TUD_CONFIG_DESCRIPTOR(1, USBD_ITF_MAX, USBD_STR_0, USBD_DESC_LEN,
|
||||
TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, USBD_MAX_POWER_MA),
|
||||
|
||||
TUD_CDC_DESCRIPTOR(USBD_ITF_CDC, USBD_STR_CDC, USBD_CDC_EP_CMD,
|
||||
|
@ -90,7 +90,7 @@ const uint8_t *tud_descriptor_configuration_cb(uint8_t index) {
|
|||
return usbd_desc_cfg;
|
||||
}
|
||||
|
||||
const uint16_t *tud_descriptor_string_cb(uint8_t index) {
|
||||
const uint16_t *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
|
||||
#define DESC_STR_MAX (20)
|
||||
static uint16_t desc_str[DESC_STR_MAX];
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ static const tusb_desc_device_t usbd_desc_device = {
|
|||
};
|
||||
|
||||
static const uint8_t usbd_desc_cfg[USBD_DESC_LEN] = {
|
||||
TUD_CONFIG_DESCRIPTOR(USBD_ITF_MAX, USBD_STR_0, USBD_DESC_LEN,
|
||||
TUD_CONFIG_DESCRIPTOR(1, USBD_ITF_MAX, USBD_STR_0, USBD_DESC_LEN,
|
||||
TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, USBD_MAX_POWER_MA),
|
||||
|
||||
TUD_CDC_DESCRIPTOR(USBD_ITF_CDC, USBD_STR_CDC, USBD_CDC_EP_CMD,
|
||||
|
@ -90,7 +90,7 @@ const uint8_t *tud_descriptor_configuration_cb(uint8_t index) {
|
|||
return usbd_desc_cfg;
|
||||
}
|
||||
|
||||
const uint16_t *tud_descriptor_string_cb(uint8_t index) {
|
||||
const uint16_t *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
|
||||
#define DESC_STR_MAX (20)
|
||||
static uint16_t desc_str[DESC_STR_MAX];
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ static const tusb_desc_device_t usbd_desc_device = {
|
|||
};
|
||||
|
||||
static const uint8_t usbd_desc_cfg[USBD_DESC_LEN] = {
|
||||
TUD_CONFIG_DESCRIPTOR(USBD_ITF_MAX, USBD_STR_0, USBD_DESC_LEN,
|
||||
TUD_CONFIG_DESCRIPTOR(1, USBD_ITF_MAX, USBD_STR_0, USBD_DESC_LEN,
|
||||
TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, USBD_MAX_POWER_MA),
|
||||
|
||||
TUD_CDC_DESCRIPTOR(USBD_ITF_CDC, USBD_STR_CDC, USBD_CDC_EP_CMD,
|
||||
|
@ -91,7 +91,7 @@ const uint8_t *tud_descriptor_configuration_cb(uint8_t index) {
|
|||
return usbd_desc_cfg;
|
||||
}
|
||||
|
||||
const uint16_t *tud_descriptor_string_cb(uint8_t index) {
|
||||
const uint16_t *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
|
||||
#define DESC_STR_MAX (20)
|
||||
static uint16_t desc_str[DESC_STR_MAX];
|
||||
|
||||
|
@ -118,29 +118,29 @@ const uint16_t *tud_descriptor_string_cb(uint8_t index) {
|
|||
#if defined(MCU_SAMD21)
|
||||
|
||||
void USB_Handler_wrapper(void) {
|
||||
USB_Handler();
|
||||
tud_int_handler(0);
|
||||
tud_task();
|
||||
}
|
||||
|
||||
#elif defined(MCU_SAMD51)
|
||||
|
||||
void USB_0_Handler_wrapper(void) {
|
||||
USB_0_Handler();
|
||||
tud_int_handler(0);
|
||||
tud_task();
|
||||
}
|
||||
|
||||
void USB_1_Handler_wrapper(void) {
|
||||
USB_1_Handler();
|
||||
tud_int_handler(0);
|
||||
tud_task();
|
||||
}
|
||||
|
||||
void USB_2_Handler_wrapper(void) {
|
||||
USB_2_Handler();
|
||||
tud_int_handler(0);
|
||||
tud_task();
|
||||
}
|
||||
|
||||
void USB_3_Handler_wrapper(void) {
|
||||
USB_3_Handler();
|
||||
tud_int_handler(0);
|
||||
tud_task();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue