[Kernel] message 可以返回消息的实际大小 (#7709)

This commit is contained in:
zhkag
2023-06-21 18:22:42 +08:00
committed by GitHub
parent b4e59bac4e
commit 33f550cb65
18 changed files with 73 additions and 56 deletions
+3 -3
View File
@@ -659,8 +659,8 @@ static void rt_usbh_hub_thread_entry(void* parameter)
struct uhost_msg msg;
/* receive message */
if(rt_mq_recv(hcd->usb_mq, &msg, sizeof(struct uhost_msg), RT_WAITING_FOREVER)
!= RT_EOK ) continue;
if (rt_mq_recv(hcd->usb_mq, &msg, sizeof(struct uhost_msg), RT_WAITING_FOREVER) < 0)
continue;
//RT_DEBUG_LOG(RT_DEBUG_USB, ("msg type %d\n", msg.type));
@@ -711,7 +711,7 @@ void rt_usbh_hub_init(uhcd_t hcd)
{
LOG_E("hcd->roothub: allocate buffer failed.");
return;
}
}
rt_memset(hcd->roothub, 0, sizeof(struct uhub));
hcd->roothub->is_roothub = RT_TRUE;
hcd->roothub->hcd = hcd;