Open xbd119 opened 2 years ago
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;
}
欢迎提交PR 谢谢反馈
uconfig_t rt_usbd_find_config(udevice_t device, rt_uint8_t value) { struct rt_list_node* node; uconfig_t cfg = RT_NULL;
}