diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2013-11-02 15:17:48 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2013-11-02 15:17:48 +0900 |
commit | 5a4a71d1ffdd557179d2c3ea3ecf6dd6928929ac (patch) | |
tree | 5792c4478010e17d39ff6ea10a01c33ba5839456 | |
parent | 9fe6cefdc0564b6bb3d938c0c1074d57a4b9500f (diff) |
Update from Gnuk
-rw-r--r-- | example-cdc/usb-cdc.c | 7 | ||||
-rw-r--r-- | example-cdc/usb_lld.h | 6 | ||||
-rw-r--r-- | example-cdc/usb_stm32f103.c | 5 |
3 files changed, 9 insertions, 9 deletions
diff --git a/example-cdc/usb-cdc.c b/example-cdc/usb-cdc.c index cd6e2d1..66da24d 100644 --- a/example-cdc/usb-cdc.c +++ b/example-cdc/usb-cdc.c @@ -253,9 +253,13 @@ usb_cb_setup (uint8_t req, uint8_t req_no, } int -usb_cb_get_descriptor (uint8_t desc_type, uint16_t index, uint16_t value) +usb_cb_get_descriptor (uint8_t rcp, uint8_t desc_type, uint8_t desc_index, + uint16_t index) { (void)index; + if (rcp != DEVICE_RECIPIENT) + return USB_UNSUPPORT; + if (desc_type == DEVICE_DESCRIPTOR) { usb_lld_set_data_to_send (vcom_device_desc, sizeof (vcom_device_desc)); @@ -269,7 +273,6 @@ usb_cb_get_descriptor (uint8_t desc_type, uint16_t index, uint16_t value) } else if (desc_type == STRING_DESCRIPTOR) { - uint8_t desc_index = value & 0xff; const uint8_t *str; int size; diff --git a/example-cdc/usb_lld.h b/example-cdc/usb_lld.h index 8dc00b9..c45c712 100644 --- a/example-cdc/usb_lld.h +++ b/example-cdc/usb_lld.h @@ -60,7 +60,8 @@ void usb_cb_ctrl_write_finish (uint8_t req, uint8_t req_no, uint16_t value, uint16_t index, uint16_t len); int usb_cb_setup (uint8_t req, uint8_t req_no, uint16_t value, uint16_t index, uint16_t len); -int usb_cb_get_descriptor (uint8_t desc_type, uint16_t index, uint16_t value); +int usb_cb_get_descriptor (uint8_t rcp, uint8_t desc_type, uint8_t desc_index, + uint16_t index); int usb_cb_handle_event (uint8_t event_type, uint16_t value); int usb_cb_interface (uint8_t cmd, uint16_t interface, uint16_t value); @@ -88,10 +89,9 @@ enum DEVICE_STATE CONFIGURED }; +extern uint32_t bDeviceState; extern const uint8_t usb_initial_feature; -#define STM32_USB_IRQ_PRIORITY 11 - extern void usb_lld_init (uint8_t feature); extern void usb_lld_to_pmabuf (const void *src, uint16_t addr, size_t n); diff --git a/example-cdc/usb_stm32f103.c b/example-cdc/usb_stm32f103.c index b75dfdb..dd33e67 100644 --- a/example-cdc/usb_stm32f103.c +++ b/example-cdc/usb_stm32f103.c @@ -697,10 +697,7 @@ static int std_get_descriptor (uint8_t req, uint16_t value, return USB_UNSUPPORT; (void)length; - if (rcp == DEVICE_RECIPIENT) - return usb_cb_get_descriptor ((value >> 8), index, value); - - return USB_UNSUPPORT; + return usb_cb_get_descriptor (rcp, (value >> 8), (value & 0xff), index); } static int std_get_configuration (uint8_t req, uint16_t value, |