AnsweredAssumed Answered

Possible bug in 5.0 stack HID device class driver

Question asked by John Strohm on Dec 9, 2014
Latest reply on Dec 16, 2014 by Jorge_Gonzalez

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

Outcomes