diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2016-06-10 08:25:00 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2016-06-10 08:25:00 +0900 |
commit | a6541cbcc650e86c893e5de2a8ca8c5607939c55 (patch) | |
tree | 8ecdb5134afef45f9a1dded1fe1c137df23bb862 /example-fs-bb48 | |
parent | 74c7b5bcb375b9098fe282abb5377eae574fc51b (diff) |
NONE sounds bad, use OK instead
Diffstat (limited to 'example-fs-bb48')
-rw-r--r-- | example-fs-bb48/usb-cdc.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/example-fs-bb48/usb-cdc.c b/example-fs-bb48/usb-cdc.c index 8e5fd9e..0936a40 100644 --- a/example-fs-bb48/usb-cdc.c +++ b/example-fs-bb48/usb-cdc.c @@ -722,24 +722,24 @@ tty_main (void *arg) usb_device_reset (&dev); continue; - case USB_EVENT_GET_DESCRIPTOR: - if (usb_get_descriptor (&dev) < 0) - usb_lld_ctrl_error (&dev); - continue; - + case USB_EVENT_DEVICE_ADDRESSED: /* The addres is assigned to the device. We don't * need to do anything for this actually, but in this * application, we maintain the USB status of the - * device. Usually, just "continue" as EVENT_NONE is + * device. Usually, just "continue" as EVENT_OK is * OK. */ - case USB_EVENT_DEVICE_ADDRESSED: chopstx_mutex_lock (&tty0.mtx); tty0.device_state = ADDRESSED; chopstx_cond_signal (&tty0.cnd); chopstx_mutex_unlock (&tty0.mtx); continue; + case USB_EVENT_GET_DESCRIPTOR: + if (usb_get_descriptor (&dev) < 0) + usb_lld_ctrl_error (&dev); + continue; + case USB_EVENT_SET_CONFIGURATION: if (usb_set_configuration (&dev) < 0) usb_lld_ctrl_error (&dev); @@ -750,17 +750,12 @@ tty_main (void *arg) usb_lld_ctrl_error (&dev); continue; - /* Non standard device request. */ case USB_EVENT_CTRL_REQUEST: + /* Device specific device request. */ if (usb_setup (&dev) < 0) usb_lld_ctrl_error (&dev); continue; - /* Control WRITE transfer finished. */ - case USB_EVENT_CTRL_WRITE_FINISH: - usb_ctrl_write_finish (&dev); - continue; - case USB_EVENT_GET_STATUS_INTERFACE: if (usb_get_status_interface (&dev) < 0) usb_lld_ctrl_error (&dev); @@ -771,11 +766,19 @@ tty_main (void *arg) usb_lld_ctrl_error (&dev); continue; - case USB_EVENT_NONE: case USB_EVENT_SET_FEATURE_DEVICE: case USB_EVENT_SET_FEATURE_ENDPOINT: case USB_EVENT_CLEAR_FEATURE_DEVICE: case USB_EVENT_CLEAR_FEATURE_ENDPOINT: + usb_lld_ctrl_ack (&dev); + continue; + + case USB_EVENT_CTRL_WRITE_FINISH: + /* Control WRITE transfer finished. */ + usb_ctrl_write_finish (&dev); + continue; + + case USB_EVENT_OK: case USB_EVENT_DEVICE_SUSPEND: default: continue; |