Skip to content

Commit 9cc7dad

Browse files
committed
1 parent 695fc40 commit 9cc7dad

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

Diff for: hardware/arduino/avr/cores/arduino/USBCore.cpp

+22-2
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,32 @@ const u8 STRING_MANUFACTURER[] PROGMEM = USB_MANUFACTURER;
6767

6868
#define DEVICE_CLASS 0x02
6969

70+
// edit by NicoHood
71+
// added new definitions for correct USB descriptors
72+
// there are even more, these are the ones we need
73+
#define USB_DEVICE_CLASS_IAD 0xEF
74+
#define USB_DEVICE_SUB_CLASS_IAD 0x02
75+
#define USB_DEVICE_PROTOCOL_IAD 0x01
76+
77+
#define USB_DEVICE_CDC_CLASS 0x02
78+
#define USB_DEVICE_CDC_SUB_CLASS 0x00
79+
#define USB_DEVICE_CDC_PROTOCOL 0x00 // NoSpecific Protocol
80+
81+
#define USB_DEVICE_NO_CLASS 0x00
82+
#define USB_DEVICE_NO_SUB_CLASS 0x00
83+
#define USB_DEVICE_NO_PROTOCOL 0x00
84+
85+
#define USB_CONFIG_POWERED_MASK 0x40
86+
#define USB_CONFIG_BUS_POWERED 0x80
87+
#define USB_CONFIG_SELF_POWERED 0xC0
88+
#define USB_CONFIG_REMOTE_WAKEUP 0x20
89+
7090
// DEVICE DESCRIPTOR
7191
const DeviceDescriptor USB_DeviceDescriptor =
72-
D_DEVICE(0x00,0x00,0x00,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,0,1);
92+
D_DEVICE(USB_DEVICE_CLASS_IAD, USB_DEVICE_SUB_CLASS_IAD, USB_DEVICE_PROTOCOL_IAD,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,0,1);
7393

7494
const DeviceDescriptor USB_DeviceDescriptorB =
75-
D_DEVICE(0xEF,0x02,0x01,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,0,1);
95+
D_DEVICE(USB_DEVICE_NO_CLASS, USB_DEVICE_NO_SUB_CLASS, USB_DEVICE_NO_PROTOCOL,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,0,1);
7696

7797
//==================================================================
7898
//==================================================================

0 commit comments

Comments
 (0)