aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoHood <NicoHood@users.noreply.github.com>2015-10-12 17:31:35 +0200
committerNicoHood <NicoHood@users.noreply.github.com>2015-10-12 18:05:34 +0200
commitca3c821c04399360d1b2a78d6b0ebb95815db861 (patch)
tree620d97fddfc8c77edc482ac5e1452beab347e493
parentf42b26c257859f1b76094972727c4ebc2b412a62 (diff)
[PHID] Fixes protocol on reenumeration
-rw-r--r--libraries/HID/HID.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/libraries/HID/HID.cpp b/libraries/HID/HID.cpp
index 411529e..be95ec2 100644
--- a/libraries/HID/HID.cpp
+++ b/libraries/HID/HID.cpp
@@ -54,6 +54,11 @@ int HID_::getDescriptor(USBSetup& setup)
return -1;
total += res;
}
+
+ // Reset the protocol on reenumeration. Normally the host should not assume the state of the protocol
+ // due to the USB specs, but Windows and Linux just assumes its in report mode.
+ protocol = HID_REPORT_PROTOCOL;
+
return total;
}
@@ -130,7 +135,7 @@ bool HID_::setup(USBSetup& setup)
HID_::HID_(void) : PluggableUSBModule(1, 1, epType),
rootNode(NULL), descriptorSize(0),
- protocol(1), idle(1)
+ protocol(HID_REPORT_PROTOCOL), idle(1)
{
epType[0] = EP_TYPE_INTERRUPT_IN;
PluggableUSB().plug(this);