From dec34c21ef19b60b858fa664b6e365e25f4f1034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20R=C3=A9tornaz?= Date: Tue, 7 Aug 2012 15:16:31 +0200 Subject: [PATCH] cc2531: change cdc-acm descriptor Change to have a real usb VID/PID and better fit the capabilities of the CC2531 hardware (enpoint size, location). Compile only if the cdc-acm class is requested. See Pull Request #18 --- cpu/cc253x/usb/cdc-acm-descriptors.c | 38 +++++++++++++++------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/cpu/cc253x/usb/cdc-acm-descriptors.c b/cpu/cc253x/usb/cdc-acm-descriptors.c index 49246c96c..8a5d7c844 100644 --- a/cpu/cc253x/usb/cdc-acm-descriptors.c +++ b/cpu/cc253x/usb/cdc-acm-descriptors.c @@ -3,20 +3,22 @@ #include "cdc.h" #include "usb-arch.h" +#if USB_CONF_CLASS == 1 + const struct usb_st_device_descriptor device_descriptor = { sizeof(struct usb_st_device_descriptor), DEVICE, - 0x0210, + 0x0200, CDC, 0, 0, CTRL_EP_SIZE, - 0xffff, - 0xffff, - 0x0030, - 2, + 0x0617, /* EPFL usb ID */ + 0x000B, /* Don't mess with it please */ + 0x0000, 1, + 2, 3, 1 }; @@ -45,7 +47,7 @@ const struct configuration_st { 1, 0, 0x80, - 50 + 250 }, { sizeof(configuration_block.comm), @@ -68,7 +70,7 @@ const struct configuration_st { sizeof(configuration_block.abstract_ctrl), CS_INTERFACE, CDC_FUNC_DESCR_ABSTRACT_CTRL_MGMNT, - 0 + 0x2, // Set line coding }, { sizeof(configuration_block.union_descr), @@ -81,16 +83,16 @@ const struct configuration_st { sizeof(configuration_block.call_mgmt), CS_INTERFACE, CDC_FUNC_DESCR_CALL_MGMNT, - 0x02, + 0x00, 1 /* data interface */ }, { sizeof(configuration_block.ep_notification), ENDPOINT, - 0x83, + 0x81, 0x03, - USB_EP3_SIZE, - 100 + USB_EP1_SIZE, + 255 /* 255ms polling, not really used so maximum value used */ }, { sizeof(configuration_block.data), @@ -100,27 +102,29 @@ const struct configuration_st { 2, CDC_DATA, 0, - TRANSPARENT_PROTOCOL, + /*TRANSPARENT_PROTOCOL*/ 0, 0 }, { sizeof(configuration_block.ep_in), ENDPOINT, - 0x81, + 0x82, 0x02, - USB_EP1_SIZE, + USB_EP2_SIZE, 0 }, { sizeof(configuration_block.ep_out), ENDPOINT, + 0x03, 0x02, - 0x02, - USB_EP2_SIZE, + USB_EP3_SIZE, 0 } - + }; const struct usb_st_configuration_descriptor const *configuration_head = (struct usb_st_configuration_descriptor const*)&configuration_block; + +#endif