Routine HID_USB_Map_Ep_To_Struct_Index() will be called if HID_IMPLEMENT_QUEUING is enabled, but the routine is disabled with #if 0/#endif. I don't see how it would even compile with HID_IMPLEMENT_QUEUING enabled.
#if 0 should be #if HID_IMPLEMENT_QUEUING
Representative code excerpts follow.
#if 0
static uint8_t HID_USB_Map_Ep_To_Struct_Index(hid_device_struct_t* devicePtr,
uint8_t ep_num
);
#endif
#if 0
/*************************************************************************//*!
*
* @name HID_USB_Map_Ep_To_Struct_Index
*
* @brief The funtion maps the endpoint num to the index of the ep data
* structure
*
* @param handle handle to identify the controller
* @param ep_num endpoint num
*
* @return index mapped index
*
*****************************************************************************/
static uint8_t HID_USB_Map_Ep_To_Struct_Index(hid_device_struct_t* devicePtr, uint8_t ep_num)
{
uint8_t count = 0;
usb_endpoints_t *ep_desc_data = devicePtr->ep_desc_data;
/* map the endpoint num to the index of the endpoint structure */
for (count = 0; count < ep_desc_data->count; count++)
{
if (ep_desc_data->ep[count].ep_num == ep_num)
{
break;
}
}
return count;
}
#endif
Hello John:
I checked the code and I think you are correct. That #if 0 must have been used for tests and developers did not correct it.
Thank you for reporting this, let me communicate it to the developers.
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------