summaryrefslogtreecommitdiff
path: root/examples/device/msc_dual_lun/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-07-01 22:38:06 +0700
committerhathach <[email protected]>2019-07-01 22:38:06 +0700
commit6991b28532605ceae685cb8be1fee904e09f12fe (patch)
tree2d383bce7e232d56ee072f5fccdf2b688228da8d /examples/device/msc_dual_lun/src
parent991aaf0158fcb02f7951a895a0caa6637e84fd8a (diff)
improving midi support, adding midi exmaple
rename TUSB_DESC_CLASS_SPECIFIC to TUSB_DESC_CS_INTERFACE
Diffstat (limited to 'examples/device/msc_dual_lun/src')
-rw-r--r--examples/device/msc_dual_lun/src/usb_descriptors.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/device/msc_dual_lun/src/usb_descriptors.c b/examples/device/msc_dual_lun/src/usb_descriptors.c
index 24bed9ecf..26ebe190c 100644
--- a/examples/device/msc_dual_lun/src/usb_descriptors.c
+++ b/examples/device/msc_dual_lun/src/usb_descriptors.c
@@ -32,7 +32,7 @@
* [MSB] HID | MSC | CDC [LSB]
*/
#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) )
+#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | _PID_MAP(MIDI, 3) )
//------------- Device Descriptors -------------//
tusb_desc_device_t const desc_device =
@@ -75,7 +75,7 @@ enum
uint8_t const desc_configuration[] =
{
- // Inteface count, string index, total length, attribute, power in mA
+ // interface count, string index, total length, attribute, power in mA
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
@@ -123,6 +123,8 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index)
chr_count = 1;
}else
{
+ // Convert ASCII string into UTF-16
+
if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
const char* str = string_desc_arr[index];