Update from Gnuk

This commit is contained in:
NIIBE Yutaka
2013-11-02 15:17:48 +09:00
parent 9fe6cefdc0
commit 5a4a71d1ff
3 changed files with 9 additions and 9 deletions

View File

@@ -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;

View File

@@ -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);

View File

@@ -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,