Closed c-hamster closed 1 year ago
如题,崩溃位置在这个地方。第一次接触cherryusb 。
void usbh_find_class_instance(const char devname) { struct usbh_hubport hport; usb_slist_t hub_list; usb_slist_for_each(hub_list, &hub_class_head) ---------------此处第二次循环出错 崩溃 { struct usbh_hub *hub = usb_slist_entry(hub_list, struct usbh_hub, list); for (uint8_t port = 0; port < hub->hub_desc.bNbrPorts; port++) {
hport = &hub->child[port]; printf("port=%d hub->hub_desc.bNbrPorts=%d connect=%d\r\n",port, hub->hub_desc.bNbrPorts,hport->connected); if (hport->connected) { for (uint8_t itf = 0; itf < hport->config.config_desc.bNumInterfaces; itf++) { if ((strncmp(hport->config.intf[itf].devname, devname, CONFIG_USBHOST_DEV_NAMELEN) == 0) && hport->config.intf[itf].priv) return hport->config.intf[itf].priv; } } } } return NULL;
}
测试没有问题,自己解决吧
你发的邮件我已经收到!谢谢!
如题,崩溃位置在这个地方。第一次接触cherryusb 。
void usbh_find_class_instance(const char devname) { struct usbh_hubport hport; usb_slist_t hub_list; usb_slist_for_each(hub_list, &hub_class_head) ---------------此处第二次循环出错 崩溃 {
struct usbh_hub *hub = usb_slist_entry(hub_list, struct usbh_hub, list); for (uint8_t port = 0; port < hub->hub_desc.bNbrPorts; port++) {
}