summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2021-02-08 23:47:49 +1100
committerDamien George <damien@micropython.org>2021-02-12 12:50:36 +1100
commit035d16126ac2e4ea9b9c1c33a15104cd952897a1 (patch)
tree5fc4582298338d86dfe464ae7c1da101988acb22
parent9b7d8b87ee317ed69c8c9963d4eb27174ac33230 (diff)
ports: Update to build with new tinyusb.
Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--ports/mimxrt/board_init.c4
-rw-r--r--ports/mimxrt/tusb_config.h1
-rw-r--r--ports/mimxrt/tusb_port.c4
-rw-r--r--ports/nrf/drivers/usb/usb_descriptors.c4
-rw-r--r--ports/samd/tusb_port.c14
5 files changed, 13 insertions, 14 deletions
diff --git a/ports/mimxrt/board_init.c b/ports/mimxrt/board_init.c
index 6f5235d3b..102764cac 100644
--- a/ports/mimxrt/board_init.c
+++ b/ports/mimxrt/board_init.c
@@ -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();
}
diff --git a/ports/mimxrt/tusb_config.h b/ports/mimxrt/tusb_config.h
index c7ec05e63..862fb6c52 100644
--- a/ports/mimxrt/tusb_config.h
+++ b/ports/mimxrt/tusb_config.h
@@ -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
diff --git a/ports/mimxrt/tusb_port.c b/ports/mimxrt/tusb_port.c
index f6b09a362..0d73b0923 100644
--- a/ports/mimxrt/tusb_port.c
+++ b/ports/mimxrt/tusb_port.c
@@ -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];
diff --git a/ports/nrf/drivers/usb/usb_descriptors.c b/ports/nrf/drivers/usb/usb_descriptors.c
index f6724c1bc..e9436ded5 100644
--- a/ports/nrf/drivers/usb/usb_descriptors.c
+++ b/ports/nrf/drivers/usb/usb_descriptors.c
@@ -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];
diff --git a/ports/samd/tusb_port.c b/ports/samd/tusb_port.c
index f3d417f1a..e96f33246 100644
--- a/ports/samd/tusb_port.c
+++ b/ports/samd/tusb_port.c
@@ -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();
}