We need to make room for the control endpoint in the HIDInterface struct as well

This is needed as the in and out endpoint are defined as follows:

static const uint8_t epInterruptInIndex = 1; // InterruptIN  endpoint index
static const uint8_t epInterruptOutIndex = 2; // InterruptOUT endpoint index

And maxEpPerInterface is set to 2.

See: https://travis-ci.org/felis/USB_Host_Shield_2.0/jobs/569260660
This commit is contained in:
Kristian Sloth Lauszus 2019-08-08 13:54:54 +02:00
parent d182729ed8
commit 912decede5
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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);