Date:2011-06-11 19:17:44 (12 years 9 months ago)
Author:Werner Almesberger
Commit:376236949bddfab48aa5a633bf707b7c418ab1e4
Message:atusb/fw/usb/: we were busy-looping on TXINI. Mask the interrupt when idle.

- usb/usb.h (usb_ep_change), usb/atu2.c (usb_ep_change): new function
called by the USB stack to notify the hardware-specific driver of
an endpoint state change (EP_TX or EP_RX)
- usb/usb.c (usb_io): call usb_ep_change
- usb/atu2.c (handle_ep): mask TXINI if we have nothing to send
Files: atusb/fw/usb/atu2.c (2 diffs)
atusb/fw/usb/usb.c (1 diff)
atusb/fw/usb/usb.h (1 diff)

Change Details

atusb/fw/usb/atu2.c
7070}
7171
7272
73void usb_ep_change(struct ep_descr *ep)
74{
75    if (ep->state == EP_TX) {
76        UENUM = ep-eps;
77        UEIENX |= 1 << TXINE;
78    }
79}
80
81
7382static int ep_setup(void)
7483{
7584    struct setup_request setup;
...... 
157166            UEINTX = ~(1 << TXINI);
158167            if (ep->state == EP_IDLE && ep->callback)
159168                ep->callback(ep->user);
169        } else {
170            UEIENX &= ~(1 << TXINE);
160171        }
161172    }
162173    return;
atusb/fw/usb/usb.c
5151    ep->end = buf+size;
5252    ep->callback = callback;
5353    ep->user = user;
54    usb_ep_change(ep);
5455}
5556
5657
atusb/fw/usb/usb.h
150150
151151int handle_setup(const struct setup_request *setup);
152152int set_addr(uint8_t addr);
153void usb_ep_change(struct ep_descr *ep);
153154void usb_reset(void);
154155void usb_init(void);
155156

Archive Download the corresponding diff file



interactive