aboutsummaryrefslogtreecommitdiff
path: root/libraries/HID
diff options
context:
space:
mode:
authorCristian Maglie <c.maglie@arduino.cc>2015-10-21 15:53:59 +0200
committerCristian Maglie <c.maglie@arduino.cc>2015-10-21 15:53:59 +0200
commiteefb9a8bcb7fb3de140dd5a06cdb6aa1bb2c450c (patch)
treebc2c5aaead34e4f86ffeb773cb4ea21d3ddb09b7 /libraries/HID
parentced062988bf0df175e54b77b658132685100b350 (diff)
parentca3c821c04399360d1b2a78d6b0ebb95815db861 (diff)
Merge remote-tracking branch 'arduino/master' into HEAD
Diffstat (limited to 'libraries/HID')
-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 1a432ff..ce9a6a0 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;
}
@@ -140,7 +145,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);