提交 b5646a20 编写于 作者: qiuyiuestc's avatar qiuyiuestc

Merge pull request #81 from grissiom/fix-usb

usbdevice/core/core.c: fix garbage value bug
......@@ -1237,7 +1237,6 @@ rt_err_t rt_usbd_set_altsetting(uintf_t intf, rt_uint8_t value)
/* parameter check */
RT_ASSERT(intf != RT_NULL);
RT_ASSERT(setting != RT_NULL);
/* find an alternate setting */
setting = rt_usbd_find_altsetting(intf, value);
......@@ -1308,6 +1307,12 @@ static void rt_usbd_thread_entry(void* parameter)
rt_kprintf("invalid usb device\n");
break;
case USB_MSG_DATA_NOTIFY:
device = rt_usbd_find_device(msg.dcd);
if(device == RT_NULL)
{
rt_kprintf("invalid usb device\n");
break;
}
ep = rt_usbd_find_endpoint(device, &cls, msg.content.ep_msg.ep_addr);
if(ep != RT_NULL)
ep->handler(device, cls, msg.content.ep_msg.size);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册