Skip to content

Commit 40e7b1d

Browse files
liu nickcmaglie
liu nick
authored andcommitted
use IAD Descriptor for device descriptor per the definition in "USB 2.0 ECN Interface Association Descriptor" and "USB Interface Association Descriptor Device Class Code and Use Model"
1 parent 3c0f26d commit 40e7b1d

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

hardware/arduino/avr/cores/arduino/USBCore.cpp

+3-9
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ volatile u8 RxLEDPulse; /**< Milliseconds remaining for data Rx LED pulse */
3434
extern const u16 STRING_LANGUAGE[] PROGMEM;
3535
extern const u8 STRING_PRODUCT[] PROGMEM;
3636
extern const u8 STRING_MANUFACTURER[] PROGMEM;
37-
extern const DeviceDescriptor USB_DeviceDescriptor PROGMEM;
38-
extern const DeviceDescriptor USB_DeviceDescriptorB PROGMEM;
37+
extern const DeviceDescriptor USB_DeviceDescriptorIAD PROGMEM;
3938
extern bool _updatedLUFAbootloader;
4039

4140
const u16 STRING_LANGUAGE[2] = {
@@ -71,10 +70,7 @@ const u8 STRING_MANUFACTURER[] PROGMEM = USB_MANUFACTURER;
7170
#define DEVICE_CLASS 0x02
7271

7372
// DEVICE DESCRIPTOR
74-
const DeviceDescriptor USB_DeviceDescriptor =
75-
D_DEVICE(0x00,0x00,0x00,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,ISERIAL,1);
76-
77-
const DeviceDescriptor USB_DeviceDescriptorB =
73+
const DeviceDescriptor USB_DeviceDescriptorIAD =
7874
D_DEVICE(0xEF,0x02,0x01,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,ISERIAL,1);
7975

8076
//==================================================================
@@ -519,9 +515,7 @@ bool SendDescriptor(USBSetup& setup)
519515
const u8* desc_addr = 0;
520516
if (USB_DEVICE_DESCRIPTOR_TYPE == t)
521517
{
522-
if (setup.wLength == 8)
523-
_cdcComposite = 1;
524-
desc_addr = _cdcComposite ? (const u8*)&USB_DeviceDescriptorB : (const u8*)&USB_DeviceDescriptor;
518+
desc_addr = (const u8*)&USB_DeviceDescriptorIAD;
525519
}
526520
else if (USB_STRING_DESCRIPTOR_TYPE == t)
527521
{

0 commit comments

Comments
 (0)