From 8df0bd6997b6c32e93cae81438d0fe97066d9099 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Tue, 11 Dec 2012 17:33:56 +0100 Subject: Corrected FIFO buffer size and offset. --- usb/dwc_otg.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usb/dwc_otg.h b/usb/dwc_otg.h index cf4e8d7..636173b 100644 --- a/usb/dwc_otg.h +++ b/usb/dwc_otg.h @@ -91,7 +91,7 @@ class USB_otg : public USB_generic { otg.reg.GRXFSIZ = rxfifo_size >> 2; buf_end = rxfifo_size >> 2; - otg.reg.DIEPTXF0 = (buf_end << 16) | (64 >> 2); + otg.reg.DIEPTXF0 = ((64 >> 2) << 16) | buf_end; buf_end += (64 >> 2); otg.dev_iep_reg[ep].DIEPTSIZ = size; @@ -104,8 +104,8 @@ class USB_otg : public USB_generic { } if(in) { - otg.reg.DIEPTXF[ep - 1] = (buf_end << 16) | (size >> 2); - buf_end += (size >> 2); + otg.reg.DIEPTXF[ep - 1] = ((size >> 2) << 16) | buf_end; + buf_end += size >> 2; otg.dev_iep_reg[ep].DIEPTSIZ = size; otg.dev_iep_reg[ep].DIEPCTL = epctl | (1 << 27) | (ep << 22); // SNAK -- cgit v1.2.3