Iterate through the correct set of HID Report IDs, plus some clean up.

This commit is contained in:
mbanth
2021-12-23 10:31:07 +00:00
parent 8c132af069
commit b61ea63d40

View File

@@ -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);