usbdevice/core: small optimization on the event loop
Sort the switch cases by the frequency of the events.
This commit is contained in:
parent
d23ee75d2e
commit
157af94af9
|
@ -1308,8 +1308,8 @@ static void rt_usbd_thread_entry(void* parameter)
|
||||||
|
|
||||||
switch (msg.type)
|
switch (msg.type)
|
||||||
{
|
{
|
||||||
case USB_MSG_SETUP_NOTIFY:
|
case USB_MSG_SOF:
|
||||||
_setup_request(device, (ureq_t)msg.content.setup_msg.packet);
|
_sof_notify(device);
|
||||||
break;
|
break;
|
||||||
case USB_MSG_DATA_NOTIFY:
|
case USB_MSG_DATA_NOTIFY:
|
||||||
ep = rt_usbd_find_endpoint(device, &cls, msg.content.ep_msg.ep_addr);
|
ep = rt_usbd_find_endpoint(device, &cls, msg.content.ep_msg.ep_addr);
|
||||||
|
@ -1318,8 +1318,8 @@ static void rt_usbd_thread_entry(void* parameter)
|
||||||
else
|
else
|
||||||
rt_kprintf("invalid endpoint\n");
|
rt_kprintf("invalid endpoint\n");
|
||||||
break;
|
break;
|
||||||
case USB_MSG_SOF:
|
case USB_MSG_SETUP_NOTIFY:
|
||||||
_sof_notify(device);
|
_setup_request(device, (ureq_t)msg.content.setup_msg.packet);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
rt_kprintf("unknown msg type\n");
|
rt_kprintf("unknown msg type\n");
|
||||||
|
|
Loading…
Reference in New Issue