summaryrefslogtreecommitdiff
path: root/components/drivers
diff options
context:
space:
mode:
authorGrissiom <[email protected]>2013-05-12 13:06:44 +0800
committerGrissiom <[email protected]>2013-05-12 13:07:03 +0800
commit157af94af99e78808aa06b7719b7eea6c879143b (patch)
treec0554bf55d103e4af459bf31d642976ce69c8476 /components/drivers
parentd23ee75d2e36a145d62dff7bb2b738a29779c716 (diff)
usbdevice/core: small optimization on the event loop
Sort the switch cases by the frequency of the events.
Diffstat (limited to 'components/drivers')
-rw-r--r--components/drivers/usb/usbdevice/core/core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/drivers/usb/usbdevice/core/core.c b/components/drivers/usb/usbdevice/core/core.c
index 104f81639b..0717414635 100644
--- a/components/drivers/usb/usbdevice/core/core.c
+++ b/components/drivers/usb/usbdevice/core/core.c
@@ -1308,8 +1308,8 @@ static void rt_usbd_thread_entry(void* parameter)
switch (msg.type)
{
- case USB_MSG_SETUP_NOTIFY:
- _setup_request(device, (ureq_t)msg.content.setup_msg.packet);
+ case USB_MSG_SOF:
+ _sof_notify(device);
break;
case USB_MSG_DATA_NOTIFY:
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
rt_kprintf("invalid endpoint\n");
break;
- case USB_MSG_SOF:
- _sof_notify(device);
+ case USB_MSG_SETUP_NOTIFY:
+ _setup_request(device, (ureq_t)msg.content.setup_msg.packet);
break;
default:
rt_kprintf("unknown msg type\n");