From c5a346a5091156599441fff8fc63d419f9f3505c Mon Sep 17 00:00:00 2001 From: Jean-Christophe Date: Mon, 10 Sep 2012 18:25:41 +0200 Subject: [PATCH] Correct HID, the send is now done in one time --- hardware/arduino/sam/cores/arduino/USB/HID.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hardware/arduino/sam/cores/arduino/USB/HID.cpp b/hardware/arduino/sam/cores/arduino/USB/HID.cpp index 27b9f9c1e..72db8e4dc 100644 --- a/hardware/arduino/sam/cores/arduino/USB/HID.cpp +++ b/hardware/arduino/sam/cores/arduino/USB/HID.cpp @@ -152,8 +152,15 @@ int WEAK HID_GetDescriptor(int i) void WEAK HID_SendReport(uint8_t id, const void* data, uint32_t len) { - USBD_Send(HID_TX, &id, 1); - USBD_Send(HID_TX | TRANSFER_RELEASE,data,len); + uint8_t p[5]; + uint8_t* d = (uint8_t*)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); } bool WEAK HID_Setup(Setup& setup)