Skip to content

Commit 0df5657

Browse files
committed
[USB] Add config and interface string descriptor index
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 0bd29f9 commit 0df5657

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

cores/arduino/stm32/usb/cdc/usbd_cdc.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_CfgHSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
175175
0x00,
176176
0x02, /* bNumInterfaces: 2 interface */
177177
0x01, /* bConfigurationValue: Configuration value */
178-
0x00, /* iConfiguration: Index of string descriptor describing the configuration */
178+
USBD_IDX_CONFIG_STR, /* iConfiguration: Index of string descriptor describing the configuration */
179179
0xC0, /* bmAttributes: self powered */
180180
0x32, /* MaxPower 0 mA */
181181

@@ -191,7 +191,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_CfgHSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
191191
0x02, /* bInterfaceClass: Communication Interface Class */
192192
0x02, /* bInterfaceSubClass: Abstract Control Model */
193193
0x00, /* bInterfaceProtocol: No specific protocol */
194-
0x00, /* iInterface: */
194+
USBD_IDX_INTERFACE_STR, /* iInterface: */
195195

196196
/*Header Functional Descriptor*/
197197
0x05, /* bLength: Endpoint Descriptor size */
@@ -239,7 +239,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_CfgHSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
239239
0x0A, /* bInterfaceClass: CDC */
240240
0x00, /* bInterfaceSubClass: */
241241
0x00, /* bInterfaceProtocol: */
242-
0x00, /* iInterface: */
242+
USBD_IDX_INTERFACE_STR, /* iInterface: */
243243

244244
/*Endpoint OUT Descriptor*/
245245
0x07, /* bLength: Endpoint Descriptor size */
@@ -270,7 +270,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_CfgFSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
270270
0x00,
271271
0x02, /* bNumInterfaces: 2 interface */
272272
0x01, /* bConfigurationValue: Configuration value */
273-
0x00, /* iConfiguration: Index of string descriptor describing the configuration */
273+
USBD_IDX_CONFIG_STR, /* iConfiguration: Index of string descriptor describing the configuration */
274274
0xC0, /* bmAttributes: self powered */
275275
0x32, /* MaxPower 0 mA */
276276

@@ -286,7 +286,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_CfgFSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
286286
0x02, /* bInterfaceClass: Communication Interface Class */
287287
0x02, /* bInterfaceSubClass: Abstract Control Model */
288288
0x00, /* bInterfaceProtocol: No specific protocol */
289-
0x00, /* iInterface: */
289+
USBD_IDX_INTERFACE_STR, /* iInterface: */
290290

291291
/*Header Functional Descriptor*/
292292
0x05, /* bLength: Endpoint Descriptor size */
@@ -334,7 +334,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_CfgFSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
334334
0x0A, /* bInterfaceClass: CDC */
335335
0x00, /* bInterfaceSubClass: */
336336
0x00, /* bInterfaceProtocol: */
337-
0x00, /* iInterface: */
337+
USBD_IDX_INTERFACE_STR, /* iInterface: */
338338

339339
/*Endpoint OUT Descriptor*/
340340
0x07, /* bLength: Endpoint Descriptor size */
@@ -362,7 +362,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_OtherSpeedCfgDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIG
362362
0x00,
363363
0x02, /* bNumInterfaces: 2 interfaces */
364364
0x01, /* bConfigurationValue: */
365-
0x04, /* iConfiguration: */
365+
USBD_IDX_CONFIG_STR, /* iConfiguration: */
366366
0xC0, /* bmAttributes: */
367367
0x32, /* MaxPower 100 mA */
368368

@@ -376,7 +376,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_OtherSpeedCfgDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIG
376376
0x02, /* bInterfaceClass: Communication Interface Class */
377377
0x02, /* bInterfaceSubClass: Abstract Control Model */
378378
0x00, /* bInterfaceProtocol: No specific protocol */
379-
0x00, /* iInterface: */
379+
USBD_IDX_INTERFACE_STR, /* iInterface: */
380380

381381
/*Header Functional Descriptor*/
382382
0x05, /* bLength: Endpoint Descriptor size */
@@ -425,7 +425,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_OtherSpeedCfgDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIG
425425
0x0A, /* bInterfaceClass: CDC */
426426
0x00, /* bInterfaceSubClass: */
427427
0x00, /* bInterfaceProtocol: */
428-
0x00, /* iInterface: */
428+
USBD_IDX_INTERFACE_STR, /* iInterface: */
429429

430430
/*Endpoint OUT Descriptor*/
431431
0x07, /* bLength: Endpoint Descriptor size */

cores/arduino/stm32/usb/hid/usbd_hid_composite.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ __ALIGN_BEGIN static uint8_t USBD_HID_CfgFSDesc[USB_COMPOSITE_HID_CONFIG_DESC_SI
143143
HIBYTE(USB_COMPOSITE_HID_CONFIG_DESC_SIZ),
144144
0x02, /*bNumInterfaces: 2 interface*/
145145
0x01, /*bConfigurationValue: Configuration value*/
146-
0x00, /*iConfiguration: Index of string descriptor describing
146+
USBD_IDX_CONFIG_STR, /*iConfiguration: Index of string descriptor describing
147147
the configuration*/
148148
0xC0, /*bmAttributes: bus powered and no Support Remote Wake-up */
149149
0x32, /*MaxPower 100 mA: this current is used for detecting Vbus*/
@@ -158,7 +158,7 @@ __ALIGN_BEGIN static uint8_t USBD_HID_CfgFSDesc[USB_COMPOSITE_HID_CONFIG_DESC_SI
158158
0x03, /*bInterfaceClass: HID*/
159159
0x01, /*bInterfaceSubClass : 1=BOOT, 0=no boot*/
160160
0x02, /*nInterfaceProtocol : 0=none, 1=keyboard, 2=mouse*/
161-
0x00, /*iInterface: Index of string descriptor*/
161+
USBD_IDX_INTERFACE_STR, /*iInterface: Index of string descriptor*/
162162
/******************** Descriptor of Joystick Mouse HID ********************/
163163
/* 18 */
164164
0x09, /*bLength: HID Descriptor size*/
@@ -194,7 +194,7 @@ __ALIGN_BEGIN static uint8_t USBD_HID_CfgFSDesc[USB_COMPOSITE_HID_CONFIG_DESC_SI
194194
0x03, /*bInterfaceClass: HID*/
195195
0x01, /*bInterfaceSubClass : 1=BOOT, 0=no boot*/
196196
0x01, /*nInterfaceProtocol : 0=none, 1=keyboard, 2=mouse*/
197-
0x00, /*iInterface: Index of string descriptor*/
197+
USBD_IDX_INTERFACE_STR, /*iInterface: Index of string descriptor*/
198198
/******************** HID Descriptor ********************/
199199
/* 43 */
200200
0x09, /*bLength: HID Descriptor size*/
@@ -226,7 +226,7 @@ __ALIGN_BEGIN static uint8_t USBD_HID_CfgHSDesc[USB_COMPOSITE_HID_CONFIG_DESC_SI
226226
HIBYTE(USB_COMPOSITE_HID_CONFIG_DESC_SIZ),
227227
0x02, /*bNumInterfaces: 2 interface*/
228228
0x01, /*bConfigurationValue: Configuration value*/
229-
0x00, /*iConfiguration: Index of string descriptor describing
229+
USBD_IDX_CONFIG_STR, /*iConfiguration: Index of string descriptor describing
230230
the configuration*/
231231
0xC0, /*bmAttributes: bus powered and no Support Remote Wake-up */
232232
0x32, /*MaxPower 100 mA: this current is used for detecting Vbus*/
@@ -241,7 +241,7 @@ __ALIGN_BEGIN static uint8_t USBD_HID_CfgHSDesc[USB_COMPOSITE_HID_CONFIG_DESC_SI
241241
0x03, /*bInterfaceClass: HID*/
242242
0x01, /*bInterfaceSubClass : 1=BOOT, 0=no boot*/
243243
0x02, /*nInterfaceProtocol : 0=none, 1=keyboard, 2=mouse*/
244-
0, /*iInterface: Index of string descriptor*/
244+
USBD_IDX_INTERFACE_STR, /*iInterface: Index of string descriptor*/
245245
/******************** Descriptor of Joystick Mouse HID ********************/
246246
/* 18 */
247247
0x09, /*bLength: HID Descriptor size*/
@@ -277,7 +277,7 @@ __ALIGN_BEGIN static uint8_t USBD_HID_CfgHSDesc[USB_COMPOSITE_HID_CONFIG_DESC_SI
277277
0x03, /*bInterfaceClass: HID*/
278278
0x01, /*bInterfaceSubClass : 1=BOOT, 0=no boot*/
279279
0x01, /*nInterfaceProtocol : 0=none, 1=keyboard, 2=mouse*/
280-
0x00, /*iInterface: Index of string descriptor*/
280+
USBD_IDX_INTERFACE_STR, /*iInterface: Index of string descriptor*/
281281
/******************** HID Descriptor ********************/
282282
/* 43 */
283283
0x09, /*bLength: HID Descriptor size*/
@@ -309,7 +309,7 @@ __ALIGN_BEGIN static uint8_t USBD_HID_OtherSpeedCfgDesc[USB_COMPOSITE_HID_CONFIG
309309
HIBYTE(USB_COMPOSITE_HID_CONFIG_DESC_SIZ),
310310
0x02, /*bNumInterfaces: 2 interface*/
311311
0x01, /*bConfigurationValue: Configuration value*/
312-
0x00, /*iConfiguration: Index of string descriptor describing
312+
USBD_IDX_CONFIG_STR, /*iConfiguration: Index of string descriptor describing
313313
the configuration*/
314314
0xC0, /*bmAttributes: bus powered and no Support Remote Wake-up */
315315
0x32, /*MaxPower 100 mA: this current is used for detecting Vbus*/
@@ -324,7 +324,7 @@ __ALIGN_BEGIN static uint8_t USBD_HID_OtherSpeedCfgDesc[USB_COMPOSITE_HID_CONFIG
324324
0x03, /*bInterfaceClass: HID*/
325325
0x01, /*bInterfaceSubClass : 1=BOOT, 0=no boot*/
326326
0x02, /*nInterfaceProtocol : 0=none, 1=keyboard, 2=mouse*/
327-
0, /*iInterface: Index of string descriptor*/
327+
USBD_IDX_INTERFACE_STR, /*iInterface: Index of string descriptor*/
328328
/******************** Descriptor of Joystick Mouse HID ********************/
329329
/* 18 */
330330
0x09, /*bLength: HID Descriptor size*/
@@ -360,7 +360,7 @@ __ALIGN_BEGIN static uint8_t USBD_HID_OtherSpeedCfgDesc[USB_COMPOSITE_HID_CONFIG
360360
0x03, /*bInterfaceClass: HID*/
361361
0x01, /*bInterfaceSubClass : 1=BOOT, 0=no boot*/
362362
0x01, /*nInterfaceProtocol : 0=none, 1=keyboard, 2=mouse*/
363-
0x00, /*iInterface: Index of string descriptor*/
363+
USBD_IDX_INTERFACE_STR, /*iInterface: Index of string descriptor*/
364364
/******************** HID Descriptor ********************/
365365
/* 43 */
366366
0x09, /*bLength: HID Descriptor size*/

0 commit comments

Comments
 (0)