summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2012-09-22 11:51:58 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2012-09-22 11:51:58 +0200
commit07fd946dd7723b6f133dd6b288221b8a18e1e49e (patch)
tree518d66085eaaf1dcdace967672abc856ef079529
parent8c7b1948fdc6adecf067ce206d2731d14b2ef77c (diff)
Configure TX FIFO on IN endpoints, not OUT.
-rw-r--r--usb/dwc_otg.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/usb/dwc_otg.h b/usb/dwc_otg.h
index 5ad253f..09a76c0 100644
--- a/usb/dwc_otg.h
+++ b/usb/dwc_otg.h
@@ -91,13 +91,12 @@ class USB_otg : public USB_generic {
}
if(in) {
- otg.dev_iep_reg[ep].DIEPTSIZ = size;
- otg.dev_iep_reg[ep].DIEPCTL = epctl | (1 << 27) | (ep << 22); // SNAK
-
- } else {
otg.reg.DIEPTXF[ep - 1] = (buf_end << 16) | (size >> 2);
buf_end += (size >> 2);
+ otg.dev_iep_reg[ep].DIEPTSIZ = size;
+ otg.dev_iep_reg[ep].DIEPCTL = epctl | (1 << 27) | (ep << 22); // SNAK
+ } else {
otg.dev_oep_reg[ep].DOEPTSIZ = (1 << 19) | size;
otg.dev_oep_reg[ep].DOEPCTL = epctl | (1 << 26); // CNAK
}