diff --git a/hardware/arduino/sam/cores/arduino/USB/HID.cpp b/hardware/arduino/sam/cores/arduino/USB/HID.cpp index 72db8e4dc..c243f4951 100644 --- a/hardware/arduino/sam/cores/arduino/USB/HID.cpp +++ b/hardware/arduino/sam/cores/arduino/USB/HID.cpp @@ -152,15 +152,13 @@ int WEAK HID_GetDescriptor(int i) void WEAK HID_SendReport(uint8_t id, const void* data, uint32_t len) { - uint8_t p[5]; - uint8_t* d = (uint8_t*)data; + uint8_t p[64]; + const uint8_t *d = reinterpret_cast(data); p[0] = id; - p[1] = d[0]; - p[2] = d[1]; - p[3] = d[2]; - p[4] = d[3]; - USBD_Send(HID_TX, p, 5); + for (uint32_t i=0; i