From 6636e2f505c968e4e67dd7c8c5fb09f4e8d13d60 Mon Sep 17 00:00:00 2001 From: mbanth Date: Fri, 4 Jun 2021 16:27:54 +0100 Subject: [PATCH] Add support for multi-byte HID Report --- lib_xua/src/core/buffer/ep/ep_buffer.xc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib_xua/src/core/buffer/ep/ep_buffer.xc b/lib_xua/src/core/buffer/ep/ep_buffer.xc index dea02295..eb6b373a 100644 --- a/lib_xua/src/core/buffer/ep/ep_buffer.xc +++ b/lib_xua/src/core/buffer/ep/ep_buffer.xc @@ -21,6 +21,7 @@ #include "testct_byref.h" #if( 0 < HID_CONTROLS ) +#include "xua_hid_report_descriptor.h" #include "user_hid.h" unsigned char g_hidData[HID_MAX_DATA_BYTES] = {0}; #endif @@ -371,7 +372,10 @@ void XUA_Buffer_Ep(register chanend c_aud_out, #endif #if( 0 < HID_CONTROLS ) - XUD_SetReady_In(ep_hid, g_hidData, 1); + { + int hidDataLength = hidGetReportLength(); + XUD_SetReady_In(ep_hid, g_hidData, hidDataLength); + } #endif #if (AUDIO_CLASS == 1) @@ -885,9 +889,9 @@ void XUA_Buffer_Ep(register chanend c_aud_out, /* HID Report Data */ case XUD_SetData_Select(c_hid, ep_hid, result): { - g_hidData[0]=0; + int hidDataLength = hidGetReportLength(); UserHIDGetData(g_hidData); - XUD_SetReady_In(ep_hid, g_hidData, 1); + XUD_SetReady_In(ep_hid, g_hidData, hidDataLength); } break; #endif