Skip to content

Commit ca3c821

Browse files
committed
[PHID] Fixes protocol on reenumeration
1 parent f42b26c commit ca3c821

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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)