summaryrefslogtreecommitdiff
path: root/examples/device
diff options
context:
space:
mode:
authorhathach <[email protected]>2020-02-07 22:13:38 +0700
committerhathach <[email protected]>2020-02-07 22:13:38 +0700
commit46f22860fb6eaf0b65469b47b099e20f489b2e47 (patch)
tree2e55bddae8cbb945d57c271c205951755837ca0b /examples/device
parent02b2c602319a55226429582dfd8002c95cc3ff87 (diff)
correct waklaround with only status IN
correct usb descriptor msc dual example to work with samg
Diffstat (limited to 'examples/device')
-rw-r--r--examples/device/cdc_msc/src/usb_descriptors.c2
-rw-r--r--examples/device/msc_dual_lun/src/usb_descriptors.c18
2 files changed, 15 insertions, 5 deletions
diff --git a/examples/device/cdc_msc/src/usb_descriptors.c b/examples/device/cdc_msc/src/usb_descriptors.c
index e8527df0b..5cae7760e 100644
--- a/examples/device/cdc_msc/src/usb_descriptors.c
+++ b/examples/device/cdc_msc/src/usb_descriptors.c
@@ -95,7 +95,7 @@ enum
#define EPNUM_MSC_IN 0x85
#elif CFG_TUSB_MCU == OPT_MCU_SAMG
- // SAMG doesn't support a same endpoint number with IN and OUT
+ // SAMG doesn't support a same endpoint number with different direction IN and OUT
// e.g EP1 OUT & EP1 IN cannot exist together
#define EPNUM_CDC_NOTIF 0x81
#define EPNUM_CDC_OUT 0x02
diff --git a/examples/device/msc_dual_lun/src/usb_descriptors.c b/examples/device/msc_dual_lun/src/usb_descriptors.c
index e0a5904a4..88a96fb9a 100644
--- a/examples/device/msc_dual_lun/src/usb_descriptors.c
+++ b/examples/device/msc_dual_lun/src/usb_descriptors.c
@@ -80,10 +80,20 @@ enum
#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX
// LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
- // 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
- #define EPNUM_MSC 0x02
+ // 0 control, 1 In, 2 Bulk, 3 Iso, 4 In, 5 Bulk etc ...
+ #define EPNUM_MSC_OUT 0x02
+ #define EPNUM_MSC_IN 0x82
+
+#elif CFG_TUSB_MCU == OPT_MCU_SAMG
+ // SAMG doesn't support a same endpoint number with different direction IN and OUT
+ // e.g EP1 OUT & EP1 IN cannot exist together
+ #define EPNUM_MSC_OUT 0x01
+ #define EPNUM_MSC_IN 0x82
+
#else
- #define EPNUM_MSC 0x01
+ #define EPNUM_MSC_OUT 0x01
+ #define EPNUM_MSC_IN 0x81
+
#endif
uint8_t const desc_configuration[] =
@@ -92,7 +102,7 @@ uint8_t const desc_configuration[] =
TUD_CONFIG_DESCRIPTOR(ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
// Interface number, string index, EP Out & EP In address, EP size
- TUD_MSC_DESCRIPTOR(ITF_NUM_MSC, 0, EPNUM_MSC, 0x80 | EPNUM_MSC, (CFG_TUSB_RHPORT0_MODE & OPT_MODE_HIGH_SPEED) ? 512 : 64),
+ TUD_MSC_DESCRIPTOR(ITF_NUM_MSC, 0, EPNUM_MSC_OUT, EPNUM_MSC_IN, (CFG_TUSB_RHPORT0_MODE & OPT_MODE_HIGH_SPEED) ? 512 : 64),
};
// Invoked when received GET CONFIGURATION DESCRIPTOR