mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-12-23 14:45:31 +02:00
Minor potential improvements of USB robustness.
- atrf/fw/atspi/atspi.c (main): add a delay to give the host more time to - atrf/fw/atspi/descr.c: we don't use EP1, so simplify the descriptors we send. Keep the EP1 descriptors around (commented out) in case we need them later, e.g., for interrupts.
This commit is contained in:
parent
c01a5e0b7a
commit
8f744bba63
@ -90,8 +90,16 @@ static void init_io(void)
|
||||
|
||||
void main(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
init_io();
|
||||
|
||||
/*
|
||||
* Make sure the host has enough time (2.5 us) to detect that we reset
|
||||
* our USB stack.
|
||||
*/
|
||||
for (i = 0; i != 10; i++);
|
||||
|
||||
usb_init();
|
||||
ep0_init();
|
||||
|
||||
|
@ -41,19 +41,22 @@ const uint8_t device_descriptor[18] = {
|
||||
/*
|
||||
* Our configuration
|
||||
*
|
||||
* While in DFU mode, we're always bus-powered.
|
||||
* We're always bus-powered.
|
||||
*/
|
||||
|
||||
const uint8_t config_descriptor[] = {
|
||||
9, /* bLength */
|
||||
USB_DT_CONFIG, /* bDescriptorType */
|
||||
#if 0
|
||||
LE(9+9+7+7), /* wTotalLength */
|
||||
#else
|
||||
LE(9+9), /* wTotalLength */
|
||||
#endif
|
||||
1, /* bNumInterfaces */
|
||||
1, /* bConfigurationValue (> 0 !) */
|
||||
0, /* iConfiguration */
|
||||
// USB_ATTR_SELF_POWERED | USB_ATTR_BUS_POWERED,
|
||||
USB_ATTR_BUS_POWERED, /* bmAttributes */
|
||||
15, /* bMaxPower */
|
||||
50/2, /* bMaxPower (50 mA) */
|
||||
|
||||
/* Interface #0 */
|
||||
|
||||
@ -61,12 +64,17 @@ const uint8_t config_descriptor[] = {
|
||||
USB_DT_INTERFACE, /* bDescriptorType */
|
||||
0, /* bInterfaceNumber */
|
||||
0, /* bAlternateSetting */
|
||||
#if 0
|
||||
2, /* bNumEndpoints */
|
||||
#else
|
||||
0,
|
||||
#endif
|
||||
USB_CLASS_VENDOR_SPEC, /* bInterfaceClass */
|
||||
0, /* bInterfaceSubClass */
|
||||
0, /* bInterfaceProtocol */
|
||||
0, /* iInterface */
|
||||
|
||||
#if 0
|
||||
/* EP OUT */
|
||||
|
||||
7, /* bLength */
|
||||
@ -84,5 +92,5 @@ const uint8_t config_descriptor[] = {
|
||||
0x02, /* bmAttributes (bulk) */
|
||||
LE(EP1_SIZE), /* wMaxPacketSize */
|
||||
0, /* bInterval */
|
||||
|
||||
#endif
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user