diff --git a/hiduniversal.h b/hiduniversal.h index 3aa4690a..757f6243 100644 --- a/hiduniversal.h +++ b/hiduniversal.h @@ -40,7 +40,7 @@ class HIDUniversal : public USBHID { uint8_t bmAltSet : 3; uint8_t bmProtocol : 2; }; - uint8_t epIndex[maxEpPerInterface]; + uint8_t epIndex[maxEpPerInterface + 1]; // We need to make room for the control endpoint as well }; uint8_t bConfNum; // configuration number diff --git a/usbhid.h b/usbhid.h index 791bed35..cf74f57d 100644 --- a/usbhid.h +++ b/usbhid.h @@ -151,7 +151,7 @@ protected: static const uint8_t maxHidInterfaces = 3; static const uint8_t maxEpPerInterface = 2; - static const uint8_t totalEndpoints = (maxHidInterfaces * maxEpPerInterface + 1); + static const uint8_t totalEndpoints = (maxHidInterfaces * maxEpPerInterface + 1); // We need to make room for the control endpoint void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr); void PrintHidDescriptor(const USB_HID_DESCRIPTOR *pDesc);