diff options
| author | hathach <[email protected]> | 2019-07-01 22:38:06 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2019-07-01 22:38:06 +0700 |
| commit | 6991b28532605ceae685cb8be1fee904e09f12fe (patch) | |
| tree | 2d383bce7e232d56ee072f5fccdf2b688228da8d /examples/device/hid_generic_inout/src | |
| parent | 991aaf0158fcb02f7951a895a0caa6637e84fd8a (diff) | |
improving midi support, adding midi exmaple
rename TUSB_DESC_CLASS_SPECIFIC to TUSB_DESC_CS_INTERFACE
Diffstat (limited to 'examples/device/hid_generic_inout/src')
| -rw-r--r-- | examples/device/hid_generic_inout/src/usb_descriptors.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/device/hid_generic_inout/src/usb_descriptors.c b/examples/device/hid_generic_inout/src/usb_descriptors.c index 3cf0f711b..ced915935 100644 --- a/examples/device/hid_generic_inout/src/usb_descriptors.c +++ b/examples/device/hid_generic_inout/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 = @@ -81,7 +81,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, protocol, report descriptor len, EP In & Out address, size & polling interval @@ -138,6 +138,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]; |
