@@ -603,7 +603,7 @@ static uint8_t flightsim_report_desc[] = {
603603// ************************************************************** 
604604
605605// USB Configuration Descriptor.  This huge descriptor tells all 
606- // of the devices capbilities . 
606+ // of the devices capabilities . 
607607static  uint8_t  config_descriptor [CONFIG_DESC_SIZE ] =  {
608608        // configuration descriptor, USB spec 9.6.3, page 264-266, Table 9-10 
609609        9 ,                                      // bLength; 
@@ -876,14 +876,14 @@ static uint8_t config_descriptor[CONFIG_DESC_SIZE] = {
876876        0x02 ,                                   // bDescriptorSubtype = MIDI_IN_JACK 
877877        0x01 ,                                   // bJackType = EMBEDDED 
878878        1 ,                                      // bJackID, ID = 1 
879-         0 ,                                      // iJack 
879+         0x05 ,                                      // iJack 
880880        // MIDI IN Jack Descriptor, B.4.3, Table B-8 (external), page 40 
881881        6 ,                                      // bLength 
882882        0x24 ,                                   // bDescriptorType = CS_INTERFACE 
883883        0x02 ,                                   // bDescriptorSubtype = MIDI_IN_JACK 
884884        0x02 ,                                   // bJackType = EXTERNAL 
885885        2 ,                                      // bJackID, ID = 2 
886-         0 ,                                      // iJack 
886+         0x05 ,                                      // iJack 
887887        // MIDI OUT Jack Descriptor, B.4.4, Table B-9, page 41 
888888        9 ,
889889        0x24 ,                                   // bDescriptorType = CS_INTERFACE 
@@ -893,7 +893,7 @@ static uint8_t config_descriptor[CONFIG_DESC_SIZE] = {
893893        1 ,                                      // bNrInputPins = 1 pin 
894894        2 ,                                      // BaSourceID(1) = 2 
895895        1 ,                                      // BaSourcePin(1) = first pin 
896-         0 ,                                      // iJack 
896+         0x05 ,                                      // iJack 
897897        // MIDI OUT Jack Descriptor, B.4.4, Table B-10, page 41 
898898        9 ,
899899        0x24 ,                                   // bDescriptorType = CS_INTERFACE 
@@ -903,56 +903,56 @@ static uint8_t config_descriptor[CONFIG_DESC_SIZE] = {
903903        1 ,                                      // bNrInputPins = 1 pin 
904904        1 ,                                      // BaSourceID(1) = 1 
905905        1 ,                                      // BaSourcePin(1) = first pin 
906-         0 ,                                      // iJack 
906+         0x05 ,                                      // iJack 
907907  #if  MIDI_NUM_CABLES  >= 2 
908- 	#define  MIDI_INTERFACE_JACK_PAIR (a , b , c , d ) \
909- 		6 , 0x24 , 0x02 , 0x01 , (a ), 0 , \
910- 		6 , 0x24 , 0x02 , 0x02 , (b ), 0 , \
911- 		9 , 0x24 , 0x03 , 0x01 , (c ), 1 , (b ), 1 , 0 , \
912- 		9 , 0x24 , 0x03 , 0x02 , (d ), 1 , (a ), 1 , 0 ,
913- 	MIDI_INTERFACE_JACK_PAIR (5 , 6 , 7 , 8 )
908+ 	#define  MIDI_INTERFACE_JACK_PAIR (a , b , c , d ,  e ) \
909+ 		6 , 0x24 , 0x02 , 0x01 , (a ), ( e ) , \
910+ 		6 , 0x24 , 0x02 , 0x02 , (b ), ( e ) , \
911+ 		9 , 0x24 , 0x03 , 0x01 , (c ), 1 , (b ), 1 , ( e ) , \
912+ 		9 , 0x24 , 0x03 , 0x02 , (d ), 1 , (a ), 1 , ( e ) ,
913+ 	MIDI_INTERFACE_JACK_PAIR (5 , 6 , 7 , 8 ,  0x06 )
914914  #endif 
915915  #if  MIDI_NUM_CABLES  >= 3 
916- 	MIDI_INTERFACE_JACK_PAIR (9 , 10 , 11 , 12 )
916+ 	MIDI_INTERFACE_JACK_PAIR (9 , 10 , 11 , 12 ,  0x07 )
917917  #endif 
918918  #if  MIDI_NUM_CABLES  >= 4 
919- 	MIDI_INTERFACE_JACK_PAIR (13 , 14 , 15 , 16 )
919+ 	MIDI_INTERFACE_JACK_PAIR (13 , 14 , 15 , 16 ,  0x08 )
920920  #endif 
921921  #if  MIDI_NUM_CABLES  >= 5 
922- 	MIDI_INTERFACE_JACK_PAIR (17 , 18 , 19 , 20 )
922+ 	MIDI_INTERFACE_JACK_PAIR (17 , 18 , 19 , 20 ,  0x09 )
923923  #endif 
924924  #if  MIDI_NUM_CABLES  >= 6 
925- 	MIDI_INTERFACE_JACK_PAIR (21 , 22 , 23 , 24 )
925+ 	MIDI_INTERFACE_JACK_PAIR (21 , 22 , 23 , 24 ,  0x0A )
926926  #endif 
927927  #if  MIDI_NUM_CABLES  >= 7 
928- 	MIDI_INTERFACE_JACK_PAIR (25 , 26 , 27 , 28 )
928+ 	MIDI_INTERFACE_JACK_PAIR (25 , 26 , 27 , 28 ,  0x0B )
929929  #endif 
930930  #if  MIDI_NUM_CABLES  >= 8 
931- 	MIDI_INTERFACE_JACK_PAIR (29 , 30 , 31 , 32 )
931+ 	MIDI_INTERFACE_JACK_PAIR (29 , 30 , 31 , 32 ,  0x0C )
932932  #endif 
933933  #if  MIDI_NUM_CABLES  >= 9 
934- 	MIDI_INTERFACE_JACK_PAIR (33 , 34 , 35 , 36 )
934+ 	MIDI_INTERFACE_JACK_PAIR (33 , 34 , 35 , 36 ,  0x0D )
935935  #endif 
936936  #if  MIDI_NUM_CABLES  >= 10 
937- 	MIDI_INTERFACE_JACK_PAIR (37 , 38 , 39 , 40 )
937+ 	MIDI_INTERFACE_JACK_PAIR (37 , 38 , 39 , 40 ,  0x0E )
938938  #endif 
939939  #if  MIDI_NUM_CABLES  >= 11 
940- 	MIDI_INTERFACE_JACK_PAIR (41 , 42 , 43 , 44 )
940+ 	MIDI_INTERFACE_JACK_PAIR (41 , 42 , 43 , 44 ,  0x0F )
941941  #endif 
942942  #if  MIDI_NUM_CABLES  >= 12 
943- 	MIDI_INTERFACE_JACK_PAIR (45 , 46 , 47 , 48 )
943+ 	MIDI_INTERFACE_JACK_PAIR (45 , 46 , 47 , 48 ,  0x10 )
944944  #endif 
945945  #if  MIDI_NUM_CABLES  >= 13 
946- 	MIDI_INTERFACE_JACK_PAIR (49 , 50 , 51 , 52 )
946+ 	MIDI_INTERFACE_JACK_PAIR (49 , 50 , 51 , 52 ,  0x11 )
947947  #endif 
948948  #if  MIDI_NUM_CABLES  >= 14 
949- 	MIDI_INTERFACE_JACK_PAIR (53 , 54 , 55 , 56 )
949+ 	MIDI_INTERFACE_JACK_PAIR (53 , 54 , 55 , 56 ,  0x12 )
950950  #endif 
951951  #if  MIDI_NUM_CABLES  >= 15 
952- 	MIDI_INTERFACE_JACK_PAIR (57 , 58 , 59 , 60 )
952+ 	MIDI_INTERFACE_JACK_PAIR (57 , 58 , 59 , 60 ,  0x13 )
953953  #endif 
954954  #if  MIDI_NUM_CABLES  >= 16 
955- 	MIDI_INTERFACE_JACK_PAIR (61 , 62 , 63 , 64 )
955+ 	MIDI_INTERFACE_JACK_PAIR (61 , 62 , 63 , 64 ,  0x14 )
956956  #endif 
957957        // Standard Bulk OUT Endpoint Descriptor, B.5.1, Table B-11, pae 42 
958958        9 ,                                      // bLength 
@@ -1710,6 +1710,71 @@ extern struct usb_string_descriptor_struct usb_string_product_name
17101710extern  struct  usb_string_descriptor_struct  usb_string_serial_number 
17111711        __attribute__ ((weak , alias ("usb_string_serial_number_default" )));
17121712
1713+ #ifdef  MIDI_INTERFACE 
1714+         extern  struct  usb_string_descriptor_struct  usb_string_midi_port1 
1715+                 __attribute__ ((weak , alias ("usb_string_midi_port1_default" )));
1716+ #if  MIDI_NUM_CABLES  >= 2 
1717+         extern  struct  usb_string_descriptor_struct  usb_string_midi_port2 
1718+                 __attribute__ ((weak , alias ("usb_string_midi_port2_default" )));
1719+ #endif 
1720+ #if  MIDI_NUM_CABLES  >= 3 
1721+         extern  struct  usb_string_descriptor_struct  usb_string_midi_port3 
1722+                 __attribute__ ((weak , alias ("usb_string_midi_port3_default" )));
1723+ #endif 
1724+ #if  MIDI_NUM_CABLES  >= 4 
1725+         extern  struct  usb_string_descriptor_struct  usb_string_midi_port4 
1726+                 __attribute__ ((weak , alias ("usb_string_midi_port4_default" )));
1727+ #endif 
1728+ #if  MIDI_NUM_CABLES  >= 5 
1729+         extern  struct  usb_string_descriptor_struct  usb_string_midi_port5 
1730+                 __attribute__ ((weak , alias ("usb_string_midi_port5_default" )));
1731+ #endif 
1732+ #if  MIDI_NUM_CABLES  >= 6 
1733+         extern  struct  usb_string_descriptor_struct  usb_string_midi_port6 
1734+                 __attribute__ ((weak , alias ("usb_string_midi_port6_default" )));
1735+ #endif 
1736+ #if  MIDI_NUM_CABLES  >= 7 
1737+         extern  struct  usb_string_descriptor_struct  usb_string_midi_port7 
1738+                 __attribute__ ((weak , alias ("usb_string_midi_port7_default" )));
1739+ #endif 
1740+ #if  MIDI_NUM_CABLES  >= 8 
1741+         extern  struct  usb_string_descriptor_struct  usb_string_midi_port8 
1742+                 __attribute__ ((weak , alias ("usb_string_midi_port8_default" )));
1743+ #endif 
1744+ #if  MIDI_NUM_CABLES  >= 9 
1745+         extern  struct  usb_string_descriptor_struct  usb_string_midi_port9 
1746+                 __attribute__ ((weak , alias ("usb_string_midi_port9_default" )));
1747+ #endif 
1748+ #if  MIDI_NUM_CABLES  >= 10 
1749+         extern  struct  usb_string_descriptor_struct  usb_string_midi_port10 
1750+                 __attribute__ ((weak , alias ("usb_string_midi_port10_default" )));
1751+ #endif 
1752+ #if  MIDI_NUM_CABLES  >= 11 
1753+         extern  struct  usb_string_descriptor_struct  usb_string_midi_port11 
1754+                 __attribute__ ((weak , alias ("usb_string_midi_port11_default" )));
1755+ #endif 
1756+ #if  MIDI_NUM_CABLES  >= 12 
1757+         extern  struct  usb_string_descriptor_struct  usb_string_midi_port12 
1758+                 __attribute__ ((weak , alias ("usb_string_midi_port12_default" )));
1759+ #endif 
1760+ #if  MIDI_NUM_CABLES  >= 13 
1761+         extern  struct  usb_string_descriptor_struct  usb_string_midi_port13 
1762+                 __attribute__ ((weak , alias ("usb_string_midi_port13_default" )));
1763+ #endif 
1764+ #if  MIDI_NUM_CABLES  >= 14 
1765+         extern  struct  usb_string_descriptor_struct  usb_string_midi_port14 
1766+                 __attribute__ ((weak , alias ("usb_string_midi_port14_default" )));
1767+ #endif 
1768+ #if  MIDI_NUM_CABLES  >= 15 
1769+         extern  struct  usb_string_descriptor_struct  usb_string_midi_port15 
1770+                 __attribute__ ((weak , alias ("usb_string_midi_port15_default" )));
1771+ #endif 
1772+ #if  MIDI_NUM_CABLES  >= 16 
1773+         extern  struct  usb_string_descriptor_struct  usb_string_midi_port16 
1774+                 __attribute__ ((weak , alias ("usb_string_midi_port16_default" )));
1775+ #endif 
1776+ #endif 
1777+ 
17131778struct  usb_string_descriptor_struct  string0  =  {
17141779        4 ,
17151780        3 ,
@@ -1743,6 +1808,119 @@ struct usb_string_descriptor_struct usb_string_xinput_security_descriptor = {
17431808            'e' , 's' , 'e' , 'r' , 'v' , 'e' , 'd' , '.' 
17441809        }
17451810};
1811+ #ifdef  MIDI_INTERFACE 
1812+         struct  usb_string_descriptor_struct  usb_string_midi_port1_default  =  {
1813+                 14 ,
1814+                 3 ,
1815+                 {'P' ,'o' ,'r' ,'t' ,' ' ,'1' }
1816+         };
1817+ #if  MIDI_NUM_CABLES  >= 2 
1818+         struct  usb_string_descriptor_struct  usb_string_midi_port2_default  =  {
1819+                 14 ,
1820+                 3 ,
1821+                 {'P' ,'o' ,'r' ,'t' ,' ' ,'2' }
1822+         };
1823+ #endif 
1824+ #if  MIDI_NUM_CABLES  >= 3 
1825+         struct  usb_string_descriptor_struct  usb_string_midi_port3_default  =  {
1826+                 14 ,
1827+                 3 ,
1828+                 {'P' ,'o' ,'r' ,'t' ,' ' ,'3' }
1829+         };
1830+ #endif 
1831+ #if  MIDI_NUM_CABLES  >= 4 
1832+         struct  usb_string_descriptor_struct  usb_string_midi_port4_default  =  {
1833+                 14 ,
1834+                 3 ,
1835+                 {'P' ,'o' ,'r' ,'t' ,' ' ,'4' }
1836+         };
1837+ #endif 
1838+ #if  MIDI_NUM_CABLES  >= 5 
1839+         struct  usb_string_descriptor_struct  usb_string_midi_port5_default  =  {
1840+                 14 ,
1841+                 3 ,
1842+                 {'P' ,'o' ,'r' ,'t' ,' ' ,'5' }
1843+         };
1844+ #endif 
1845+ #if  MIDI_NUM_CABLES  >= 6 
1846+         struct  usb_string_descriptor_struct  usb_string_midi_port6_default  =  {
1847+                 14 ,
1848+                 3 ,
1849+                 {'P' ,'o' ,'r' ,'t' ,' ' ,'6' }
1850+         };
1851+ #endif 
1852+ #if  MIDI_NUM_CABLES  >= 7 
1853+         struct  usb_string_descriptor_struct  usb_string_midi_port7_default  =  {
1854+                 14 ,
1855+                 3 ,
1856+                 {'P' ,'o' ,'r' ,'t' ,' ' ,'7' }
1857+         };
1858+ #endif 
1859+ #if  MIDI_NUM_CABLES  >= 8 
1860+         struct  usb_string_descriptor_struct  usb_string_midi_port8_default  =  {
1861+                 14 ,
1862+                 3 ,
1863+                 {'P' ,'o' ,'r' ,'t' ,' ' ,'8' }
1864+         };
1865+ #endif 
1866+ #if  MIDI_NUM_CABLES  >= 9 
1867+         struct  usb_string_descriptor_struct  usb_string_midi_port9_default  =  {
1868+                 14 ,
1869+                 3 ,
1870+                 {'P' ,'o' ,'r' ,'t' ,' ' ,'9' }
1871+         };
1872+ #endif 
1873+ #if  MIDI_NUM_CABLES  >= 10 
1874+         struct  usb_string_descriptor_struct  usb_string_midi_port10_default  =  {
1875+                 16 ,
1876+                 3 ,
1877+                 {'P' ,'o' ,'r' ,'t' ,' ' ,'1' ,'0' }
1878+         };
1879+ #endif 
1880+ #if  MIDI_NUM_CABLES  >= 11 
1881+         struct  usb_string_descriptor_struct  usb_string_midi_port11_default  =  {
1882+                 16 ,
1883+                 3 ,
1884+                 {'P' ,'o' ,'r' ,'t' ,' ' ,'1' ,'1' }
1885+         };
1886+ #endif 
1887+ #if  MIDI_NUM_CABLES  >= 12 
1888+         struct  usb_string_descriptor_struct  usb_string_midi_port12_default  =  {
1889+                 16 ,
1890+                 3 ,
1891+                 {'P' ,'o' ,'r' ,'t' ,' ' ,'1' ,'2' }
1892+         };
1893+ #endif 
1894+ #if  MIDI_NUM_CABLES  >= 13 
1895+         struct  usb_string_descriptor_struct  usb_string_midi_port13_default  =  {
1896+                 16 ,
1897+                 3 ,
1898+                 {'P' ,'o' ,'r' ,'t' ,' ' ,'1' ,'3' }
1899+         };
1900+ #endif 
1901+ #if  MIDI_NUM_CABLES  >= 14 
1902+         struct  usb_string_descriptor_struct  usb_string_midi_port14_default  =  {
1903+                 16 ,
1904+                 3 ,
1905+                 {'P' ,'o' ,'r' ,'t' ,' ' ,'1' ,'4' }
1906+         };
1907+ #endif 
1908+ #if  MIDI_NUM_CABLES  >= 15 
1909+         struct  usb_string_descriptor_struct  usb_string_midi_port15_default  =  {
1910+                 16 ,
1911+                 3 ,
1912+                 {'P' ,'o' ,'r' ,'t' ,' ' ,'1' ,'5' }
1913+         };
1914+ #endif 
1915+ #if  MIDI_NUM_CABLES  >= 16 
1916+         struct  usb_string_descriptor_struct  usb_string_midi_port16_default  =  {
1917+                 16 ,
1918+                 3 ,
1919+                 {'P' ,'o' ,'r' ,'t' ,' ' ,'1' ,'6' }
1920+         };
1921+ #endif 
1922+ #endif 
1923+ 
17461924#ifdef  MTP_INTERFACE 
17471925struct  usb_string_descriptor_struct  usb_string_mtp  =  {
17481926	2  +  3  *  2 ,
@@ -1830,6 +2008,54 @@ const usb_descriptor_list_t usb_descriptor_list[] = {
18302008#endif 
18312009#ifdef  MTP_INTERFACE 
18322010	{0x0304 , 0x0409 , (const  uint8_t  * )& usb_string_mtp , 0 },
2011+ #endif 
2012+ #ifdef  MIDI_INTERFACE 
2013+ 	{0x0305 , 0x0409 , (const  uint8_t  * )& usb_string_midi_port1 , 0 },
2014+ #if  MIDI_NUM_CABLES  >= 2 
2015+ 	{0x0306 , 0x0409 , (const  uint8_t  * )& usb_string_midi_port2 , 0 },
2016+ #endif 
2017+ #if  MIDI_NUM_CABLES  >= 3 
2018+ 	{0x0307 , 0x0409 , (const  uint8_t  * )& usb_string_midi_port3 , 0 },
2019+ #endif 
2020+ #if  MIDI_NUM_CABLES  >= 4 
2021+ 	{0x0308 , 0x0409 , (const  uint8_t  * )& usb_string_midi_port4 , 0 },
2022+ #endif 
2023+ #if  MIDI_NUM_CABLES  >= 5 
2024+ 	{0x0309 , 0x0409 , (const  uint8_t  * )& usb_string_midi_port5 , 0 },
2025+ #endif 
2026+ #if  MIDI_NUM_CABLES  >= 6 
2027+ 	{0x030A , 0x0409 , (const  uint8_t  * )& usb_string_midi_port6 , 0 },
2028+ #endif 
2029+ #if  MIDI_NUM_CABLES  >= 7 
2030+ 	{0x030B , 0x0409 , (const  uint8_t  * )& usb_string_midi_port7 , 0 },
2031+ #endif 
2032+ #if  MIDI_NUM_CABLES  >= 8 
2033+ 	{0x030C , 0x0409 , (const  uint8_t  * )& usb_string_midi_port8 , 0 },
2034+ #endif 
2035+ #if  MIDI_NUM_CABLES  >= 9 
2036+ 	{0x030D , 0x0409 , (const  uint8_t  * )& usb_string_midi_port9 , 0 },
2037+ #endif 
2038+ #if  MIDI_NUM_CABLES  >= 10 
2039+ 	{0x030E , 0x0409 , (const  uint8_t  * )& usb_string_midi_port10 , 0 },
2040+ #endif 
2041+ #if  MIDI_NUM_CABLES  >= 11 
2042+ 	{0x030F , 0x0409 , (const  uint8_t  * )& usb_string_midi_port11 , 0 },
2043+ #endif 
2044+ #if  MIDI_NUM_CABLES  >= 12 
2045+ 	{0x0310 , 0x0409 , (const  uint8_t  * )& usb_string_midi_port12 , 0 },
2046+ #endif 
2047+ #if  MIDI_NUM_CABLES  >= 13 
2048+ 	{0x0311 , 0x0409 , (const  uint8_t  * )& usb_string_midi_port13 , 0 },
2049+ #endif 
2050+ #if  MIDI_NUM_CABLES  >= 14 
2051+ 	{0x0312 , 0x0409 , (const  uint8_t  * )& usb_string_midi_port14 , 0 },
2052+ #endif 
2053+ #if  MIDI_NUM_CABLES  >= 15 
2054+ 	{0x0313 , 0x0409 , (const  uint8_t  * )& usb_string_midi_port15 , 0 },
2055+ #endif 
2056+ #if  MIDI_NUM_CABLES  >= 16 
2057+ 	{0x0314 , 0x0409 , (const  uint8_t  * )& usb_string_midi_port16 , 0 },
2058+ #endif 
18332059#endif 
18342060        {0x0300 , 0x0000 , (const  uint8_t  * )& string0 , 0 },
18352061        {0x0301 , 0x0409 , (const  uint8_t  * )& usb_string_manufacturer_name , 0 },
0 commit comments