Commit graph

10 commits

Author SHA1 Message Date
Daniel Gibson
4214caff70 Derive HIDUniversal from HIDComposite
They were mostly the same, I only had to keep the original
version of Poll() because while the differences are very small,
I don't think that unifying them is possible without needlessly
complicating things.
For this to work I had to make the private fields of HIDComposite
protected instead. I took the "+1" in HIDInterface::epIndex[]
from the original HIDUniversal class.
2021-01-13 15:46:46 +01:00
Daniel Gibson
6d7984ade2 Log info when not adding Interface/Endpoint because max is reached 2021-01-13 07:14:36 +01:00
Daniel Gibson
59af2be74f HIDUniversal, HIDComposite: Don't overflow hidInterfaces[] or epInfo[]
If a connected device has more than 3 (maxHidInterfaces) HID interfaces,
which is not unusual with modern keyboards, EndpointXtract() wrote
beyond the hidInterfaces[] array and corrupted bHasReportId, PID + VID.

The same could happen with the epInfo[] array.
Now this is fixed by checking bNumIface/bNMumEP before adding new
elements to those arrays.
2021-01-12 01:42:48 +01:00
Kristian Sloth Lauszus
597d389ae6 Fixed bit mask indicating the transfer type when reading the attributes in an endpoint
Fixes #313
2017-09-05 10:37:32 +07:00
Kristian Sloth Lauszus
42948831ce Explicit cast millis() and micros() to uint32_t, as it is uint64_t on the Arduino 101 2017-02-12 16:58:14 +01:00
Kristian Sloth Lauszus
6fb48f48e4 Fix millis() and micros() rollover bug
Also replace long with int32_t, so it is not architecture dependent
2017-02-12 15:10:07 +01:00
Hakan Lindestaf
83a52b5063 Fixed tab/space and added comments 2016-03-23 13:21:49 -07:00
Hakan Lindestaf
c1c955c225 #217 Fixed order of parameters 2016-03-23 13:21:49 -07:00
Hakan Lindestaf
a3b8e8d00b #217 Include endpoint in ParseHIDData 2016-03-23 13:21:49 -07:00
Hakan Lindestaf
1fe606aa22 #217 Added new class for HIDComposite that can listen to multiple interfaces. Added example for multimedia keyboard 2016-03-23 13:21:48 -07:00