From b61ea63d40ebf2c7eefd31c6dde9bab21ee503a9 Mon Sep 17 00:00:00 2001 From: mbanth Date: Thu, 23 Dec 2021 10:31:07 +0000 Subject: [PATCH] Iterate through the correct set of HID Report IDs, plus some clean up. --- lib_xua/src/core/buffer/ep/ep_buffer.xc | 6 +++--- 1 file changed, 3 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 d87db99b..e2f81ef4 100644 --- a/lib_xua/src/core/buffer/ep/ep_buffer.xc +++ b/lib_xua/src/core/buffer/ep/ep_buffer.xc @@ -24,7 +24,7 @@ #include "xua_hid_report.h" #include "user_hid.h" #include "xua_hid.h" -unsigned char g_hidData[HID_MAX_DATA_BYTES] = {0}; +unsigned char g_hidData[HID_MAX_DATA_BYTES] = {0U}; #endif void GetADCCounts(unsigned samFreq, int &min, int &mid, int &max); @@ -894,13 +894,13 @@ void XUA_Buffer_Ep(register chanend c_aud_out, #if( 0 < HID_CONTROLS ) /* HID Report Data */ - case hidIsChangePending(0U) || !HidIsSetIdleSilenced(0U) => XUD_SetData_Select(c_hid, ep_hid, result): + case (hidIsChangePending(0U) || !HidIsSetIdleSilenced(0U)) => XUD_SetData_Select(c_hid, ep_hid, result): { timer tmr; unsigned reportTime; tmr :> reportTime; - for(unsigned id = 0U; id < hidGetReportIdLimit(); ++id) { + for(unsigned id = hidIsReportIdInUse(); id < hidGetReportIdLimit(); ++id) { if(0U == id || (hidIsChangePending(id) || !HidIsSetIdleSilenced(id))) { hidCaptureReportTime(id, reportTime); int hidDataLength = (int) UserHIDGetData(id, g_hidData);