summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-11-28 16:10:31 +0700
committerhathach <[email protected]>2018-11-28 16:10:31 +0700
commit8b03b6d3b45167b8db805ca95aafce92a1a2e4b0 (patch)
tree2d750c447dfbfb09d23628fcdbcd74154f1064ca /examples
parenta3cc52829b81e80fa37c33be5c0d0c81c909cfb7 (diff)
add Auto descriptor endpoint num config to support lpc17xx
CFG_TUD_DESC_*_EPNUM
Diffstat (limited to 'examples')
-rw-r--r--examples/device/cdc_msc_hid/src/tusb_config.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/examples/device/cdc_msc_hid/src/tusb_config.h b/examples/device/cdc_msc_hid/src/tusb_config.h
index 0634c9576..a9a356f20 100644
--- a/examples/device/cdc_msc_hid/src/tusb_config.h
+++ b/examples/device/cdc_msc_hid/src/tusb_config.h
@@ -52,7 +52,7 @@
// defined by compiler flags for flexibility
#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU should be defined using compiler flags
+ #error CFG_TUSB_MCU must be defined
#endif
#if CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_LPC18XX
@@ -93,12 +93,22 @@
*/
#define CFG_TUD_DESC_AUTO 1
-/* USB VID/PID if not defined, tinyusb to use default value
+/* If USB VID/PID is not defined, tinyusb will use default value
* Note: different class combination e.g CDC and (CDC + MSC) should have different
* PID since Host OS will "remembered" device driver after the first plug */
// #define CFG_TUD_DESC_VID 0xCAFE
// #define CFG_TUD_DESC_PID 0x0001
+// LPC175x_6x's endpoint type (bulk/interrupt/iso) are fixed by its number
+// Therefor we need to force endpoint number to correct type on lpc17xx
+#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X
+#define CFG_TUD_DESC_CDC_EPNUM_NOTIF 1
+#define CFG_TUD_DESC_CDC_EPNUM 2
+#define CFG_TUD_DESC_MSC_EPNUM 5
+#define CFG_TUD_DESC_HID_KEYBOARD_EPNUM 4
+#define CFG_TUD_DESC_HID_MOUSE_EPNUM 7
+#endif
+
//------------- CLASS -------------//
#define CFG_TUD_CDC 1
#define CFG_TUD_MSC 1
@@ -114,7 +124,6 @@
#define CFG_TUD_HID_KEYBOARD_BOOT 1
#define CFG_TUD_HID_MOUSE_BOOT 1
-
//--------------------------------------------------------------------
// CDC
//--------------------------------------------------------------------