mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Some corrections as agreed with @Lauszus. Added flag bRptProtoEnable to HIDBoot() constructor. The flag defaults to false in order to maintain current behavior (Boot Protocol). If flag is the to true, HIDBoot() will enable the Report Protocol. This modification is very useful for communication with HID devices with the full, richer, Report Protocol.
This commit is contained in:
parent
e9c28d762d
commit
a948b7afe5
1 changed files with 3 additions and 3 deletions
|
@ -253,7 +253,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <const uint8_t BOOT_PROTOCOL>
|
template <const uint8_t BOOT_PROTOCOL>
|
||||||
HIDBoot<BOOT_PROTOCOL>::HIDBoot(USB *p, bool bRptProtoEnable) :
|
HIDBoot<BOOT_PROTOCOL>::HIDBoot(USB *p, bool bRptProtoEnable/* = false*/) :
|
||||||
USBHID(p),
|
USBHID(p),
|
||||||
qNextPollTime(0),
|
qNextPollTime(0),
|
||||||
bPollEnable(false),
|
bPollEnable(false),
|
||||||
|
@ -458,7 +458,7 @@ uint8_t HIDBoot<BOOT_PROTOCOL>::Init(uint8_t parent, uint8_t port, bool lowspeed
|
||||||
// Yes, mouse wants SetProtocol and SetIdle too!
|
// Yes, mouse wants SetProtocol and SetIdle too!
|
||||||
for(uint8_t i = 0; i < epMUL(BOOT_PROTOCOL); i++) {
|
for(uint8_t i = 0; i < epMUL(BOOT_PROTOCOL); i++) {
|
||||||
USBTRACE2("\r\nInterface:", i);
|
USBTRACE2("\r\nInterface:", i);
|
||||||
rcode = SetProtocol(i, bRptProtoEnable ? HID_RPT_PROTOCOL : HID_BOOT_PROTOCOL);
|
rcode = SetProtocol(i, bRptProtoEnable ? HID_RPT_PROTOCOL : USB_HID_BOOT_PROTOCOL);
|
||||||
if(rcode) goto FailSetProtocol;
|
if(rcode) goto FailSetProtocol;
|
||||||
USBTRACE2("PROTOCOL SET HID_BOOT rcode:", rcode);
|
USBTRACE2("PROTOCOL SET HID_BOOT rcode:", rcode);
|
||||||
rcode = SetIdle(i, 0, 0);
|
rcode = SetIdle(i, 0, 0);
|
||||||
|
|
Loading…
Reference in a new issue