mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-29 10:30:24 +00:00
[Kernel] message 可以返回消息的实际大小 (#7709)
This commit is contained in:
@@ -627,7 +627,7 @@ static void hid_thread_entry(void* parameter)
|
||||
hiddev = (struct hid_s *)parameter;
|
||||
while(1)
|
||||
{
|
||||
if(rt_mq_recv(&hiddev->hid_mq, &report, sizeof(report),RT_WAITING_FOREVER) != RT_EOK )
|
||||
if(rt_mq_recv(&hiddev->hid_mq, &report, sizeof(report),RT_WAITING_FOREVER) < 0)
|
||||
continue;
|
||||
HID_Report_Received(&report);
|
||||
}
|
||||
|
||||
@@ -2160,7 +2160,7 @@ static void rt_usbd_thread_entry(void* parameter)
|
||||
|
||||
/* receive message */
|
||||
if(rt_mq_recv(&usb_mq, &msg, sizeof(struct udev_msg),
|
||||
RT_WAITING_FOREVER) != RT_EOK )
|
||||
RT_WAITING_FOREVER) < 0)
|
||||
continue;
|
||||
|
||||
device = rt_usbd_find_device(msg.dcd);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user