rt-thread icon indicating copy to clipboard operation
rt-thread copied to clipboard

rt_usbd_find_config() 函数一个错误

Open xbd119 opened this issue 3 years ago • 1 comments

uconfig_t rt_usbd_find_config(udevice_t device, rt_uint8_t value) { struct rt_list_node* node; uconfig_t cfg = RT_NULL;

RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usbd_find_config\n"));

/* parameter check */
RT_ASSERT(device != RT_NULL);
RT_ASSERT(value <= device->dev_desc.bNumConfigurations);

/* search a configration in the the device */
for (node = device->cfg_list.next; node != &device->cfg_list; node = node->next)
{
    cfg = (uconfig_t)rt_list_entry(node, struct udevice, list);                                           //**udevice 应该改为uconfig_t**
    if(cfg->cfg_desc.bConfigurationValue == value)
    {
        return cfg;
    }
}

rt_kprintf("can't find configuration %d\n", value);
return RT_NULL;

}

xbd119 avatar Oct 18 '22 08:10 xbd119

欢迎提交PR 谢谢反馈

mysterywolf avatar Oct 26 '22 04:10 mysterywolf