summaryrefslogtreecommitdiff
path: root/firmware/target/arm
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2009-05-23 14:50:30 +0000
committerFrank Gevaerts <frank@gevaerts.be>2009-05-23 14:50:30 +0000
commit7557d5679d608cc1611e22f30f068132a8d864a8 (patch)
tree92b4558dfd27f0a80baf1cdf2bcd22228ac8dd33 /firmware/target/arm
parent08fb988e87b2d41830b390bae94810c4937675b5 (diff)
Clarify comment and clean up a bit (FS#10227 by Tomer Shalev)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21055 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/usb-drv-arc.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/firmware/target/arm/usb-drv-arc.c b/firmware/target/arm/usb-drv-arc.c
index 8a10c5fbd6..3dc7b21151 100644
--- a/firmware/target/arm/usb-drv-arc.c
+++ b/firmware/target/arm/usb-drv-arc.c
@@ -829,12 +829,11 @@ int usb_drv_request_endpoint(int type, int dir)
return -1;
}
- log_ep(ep_num, ep_dir, "add");
endpoint->allocated[ep_dir] = 1;
endpoint->type[ep_dir] = ep_type;
- log_ep(ep_num, ep_dir, "got");
+ log_ep(ep_num, ep_dir, "add");
return (ep_num | (dir & USB_ENDPOINT_DIR_MASK));
}
@@ -998,13 +997,13 @@ static void init_endpoints(void)
for(ep_num=1;ep_num<USB_NUM_ENDPOINTS;ep_num++) {
usb_endpoint_t *endpoint = &endpoints[ep_num];
- /* manual: 32.9.5.18 (Caution) */
- if (!endpoint->allocated[DIR_OUT]) {
+ /* manual: 32.9.5.18 (Caution): Leaving an unconfigured endpoint control
+ * will cause undefined behavior for the data pid tracking on the active
+ * endpoint/direction. */
+ if (!endpoint->allocated[DIR_OUT])
endpoint->type[DIR_OUT] = USB_ENDPOINT_XFER_BULK;
- }
- if (!endpoint->allocated[DIR_IN]) {
+ if (!endpoint->allocated[DIR_IN])
endpoint->type[DIR_IN] = USB_ENDPOINT_XFER_BULK;
- }
REG_ENDPTCTRL(ep_num) =
EPCTRL_RX_DATA_TOGGLE_RST | EPCTRL_RX_ENABLE |