Skip to content

Commit 6c05963

Browse files
committed
Descriptor type (0x03) should be second byte for string descriptor
1 parent a073e9d commit 6c05963

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cores/arduino/USB/USBCore.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ bool USBDeviceClass::sendStringDescriptor(const uint8_t *string, uint8_t maxlen)
9191
return false;
9292

9393
uint8_t buffer[maxlen];
94-
buffer[0] = 0x03;
95-
buffer[1] = strlen((const char*)string) * 2 + 2;
94+
buffer[0] = strlen((const char*)string) * 2 + 2;
95+
buffer[1] = 0x03;
9696

9797
uint8_t i;
9898
for (i = 2; i < maxlen && *string; i++) {

0 commit comments

Comments
 (0)