Skip to content

Commit 1ff4f1b

Browse files
committed
Merge branch 'usbportocolfix' of https://github.com/NicoHood/Arduino
2 parents c1ce649 + 9fe2023 commit 1ff4f1b

File tree

1 file changed

+6
-1
lines changed
  • hardware/arduino/avr/libraries/HID

1 file changed

+6
-1
lines changed

hardware/arduino/avr/libraries/HID/HID.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ int HID_::getDescriptor(USBSetup& setup)
5454
return -1;
5555
total += res;
5656
}
57+
58+
// Reset the protocol on reenumeration. Normally the host should not assume the state of the protocol
59+
// due to the USB specs, but Windows and Linux just assumes its in report mode.
60+
protocol = HID_REPORT_PROTOCOL;
61+
5762
return total;
5863
}
5964

@@ -130,7 +135,7 @@ bool HID_::setup(USBSetup& setup)
130135

131136
HID_::HID_(void) : PluggableUSBModule(1, 1, epType),
132137
rootNode(NULL), descriptorSize(0),
133-
protocol(1), idle(1)
138+
protocol(HID_REPORT_PROTOCOL), idle(1)
134139
{
135140
epType[0] = EP_TYPE_INTERRUPT_IN;
136141
PluggableUSB().plug(this);

0 commit comments

Comments
 (0)