Date:2010-08-24 23:31:58 (9 years 26 days ago)
Author:Werner Almesberger
Commit:8f744bba6362cb356df6986034c4498568aaa84a
Message: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.
Files: atrf/fw/atspi/atspi.c (1 diff)
atrf/fw/atspi/descr.c (3 diffs)

Change Details

atrf/fw/atspi/atspi.c
9090
9191void main(void)
9292{
93    int i;
94
9395    init_io();
9496
97    /*
98     * Make sure the host has enough time (2.5 us) to detect that we reset
99     * our USB stack.
100     */
101    for (i = 0; i != 10; i++);
102
95103    usb_init();
96104    ep0_init();
97105
atrf/fw/atspi/descr.c
4141/*
4242 * Our configuration
4343 *
44 * While in DFU mode, we're always bus-powered.
44 * We're always bus-powered.
4545 */
4646
4747const uint8_t config_descriptor[] = {
4848    9, /* bLength */
4949    USB_DT_CONFIG, /* bDescriptorType */
50#if 0
5051    LE(9+9+7+7), /* wTotalLength */
52#else
53    LE(9+9), /* wTotalLength */
54#endif
5155    1, /* bNumInterfaces */
5256    1, /* bConfigurationValue (> 0 !) */
5357    0, /* iConfiguration */
54// USB_ATTR_SELF_POWERED | USB_ATTR_BUS_POWERED,
5558    USB_ATTR_BUS_POWERED, /* bmAttributes */
56    15, /* bMaxPower */
59    50/2, /* bMaxPower (50 mA) */
5760
5861    /* Interface #0 */
5962
...... 
6164    USB_DT_INTERFACE, /* bDescriptorType */
6265    0, /* bInterfaceNumber */
6366    0, /* bAlternateSetting */
67#if 0
6468    2, /* bNumEndpoints */
69#else
70    0,
71#endif
6572    USB_CLASS_VENDOR_SPEC, /* bInterfaceClass */
6673    0, /* bInterfaceSubClass */
6774    0, /* bInterfaceProtocol */
6875    0, /* iInterface */
6976
77#if 0
7078    /* EP OUT */
7179
7280    7, /* bLength */
...... 
8492    0x02, /* bmAttributes (bulk) */
8593    LE(EP1_SIZE), /* wMaxPacketSize */
8694    0, /* bInterval */
87
95#endif
8896};

Archive Download the corresponding diff file



interactive