We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a23721a commit 43cf5b0Copy full SHA for 43cf5b0
hardware/arduino/sam/cores/arduino/USB/HID.cpp
@@ -152,15 +152,13 @@ int WEAK HID_GetDescriptor(int i)
152
153
void WEAK HID_SendReport(uint8_t id, const void* data, uint32_t len)
154
{
155
- uint8_t p[5];
156
- uint8_t* d = (uint8_t*)data;
+ uint8_t p[64];
+ const uint8_t *d = reinterpret_cast<const uint8_t *>(data);
157
158
p[0] = id;
159
- p[1] = d[0];
160
- p[2] = d[1];
161
- p[3] = d[2];
162
- p[4] = d[3];
163
- USBD_Send(HID_TX, p, 5);
+ for (uint32_t i=0; i<len; i++)
+ p[i+1] = d[i];
+ USBD_Send(HID_TX, p, len+1);
164
}
165
166
bool WEAK HID_Setup(Setup& setup)
0 commit comments