Merge pull request #1 from ACascarino/feature/multiple_hid_reports

Update lib_xua multiple_hid_reports from review
This commit is contained in:
Ciaran Woodward
2021-12-20 17:21:25 +00:00
committed by GitHub
4 changed files with 64 additions and 47 deletions

View File

@@ -375,18 +375,12 @@ void XUA_Buffer_Ep(register chanend c_aud_out,
#if( 0 < HID_CONTROLS )
UserHIDInit();
{
int hidReportLength = 0;
unsigned hidReportId;
while(0 == hidReportLength) {
for( hidReportId = 0U; hidReportId < hidGetReportIdLimit(); ++hidReportId) {
hidReportLength = (int) hidGetReportLength(hidReportId);
if(0 < hidReportLength) {
break;
}
}
}
while (!hidIsReportDescriptorPrepared())
;
/* Get data from the last report, which which we can prep XUD*/
int hidReportLength = (int) UserHIDGetData(hidGetReportIdLimit() - 1, g_hidData);
hidReportLength = (int) UserHIDGetData(hidReportId, g_hidData);
XUD_SetReady_In(ep_hid, g_hidData, hidReportLength);
}
#endif

View File

@@ -213,6 +213,11 @@ unsigned hidGetNextReportTime( const unsigned id ) {
return retVal;
}
unsigned hidIsReportDescriptorPrepared( void )
{
return s_hidReportDescriptorPrepared;
}
unsigned char* hidGetReportDescriptor( void )
{
unsigned char* retVal = NULL;

View File

@@ -142,6 +142,15 @@ typedef struct
*/
void hidClearChangePending( const unsigned id );
/**
* @brief Indicate if the HID Report descriptor has been prepared
*
* \returns A Boolean indicating whether the HID Report descriptor has been prepared.
* \retval True The HID Report descriptor has been prepared.
* \retval False The HID Report descriptor has not been prepared.
*/
unsigned hidIsReportDescriptorPrepared( void );
/**
* @brief Get the HID Report descriptor
*