summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-09-08 01:50:36 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-09-08 01:50:36 +0000
commitdbea731503008190185abbdccc5966d989d150f4 (patch)
tree6136bd480089147439473f72265bbaa20fbe9b9f /firmware
parent9503e6ede3e22747c911ff1dac14007b9eb3269a (diff)
downloadrockbox-dbea731503008190185abbdccc5966d989d150f4.tar.gz
rockbox-dbea731503008190185abbdccc5966d989d150f4.tar.bz2
rockbox-dbea731503008190185abbdccc5966d989d150f4.zip
USB AMSv2: update endpoint->len on transfer
cosmetics: x ? true : false -> x git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28034 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/as3525/usb-drv-as3525v2.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/firmware/target/arm/as3525/usb-drv-as3525v2.c b/firmware/target/arm/as3525/usb-drv-as3525v2.c
index 7537e874d3..4db61abc3f 100644
--- a/firmware/target/arm/as3525/usb-drv-as3525v2.c
+++ b/firmware/target/arm/as3525/usb-drv-as3525v2.c
@@ -481,14 +481,14 @@ static void handle_ep_int(int ep, bool dir_in)
endpoint->busy = false;
endpoint->status = 0;
/* works even for EP0 */
- int transfered = endpoint->len - (DIEPTSIZ(ep) & DEPTSIZ_xfersize_bits);
- logf("len=%d reg=%ld xfer=%d", endpoint->len,
- (DIEPTSIZ(ep) & DEPTSIZ_xfersize_bits),
- transfered);
+ int size = (DIEPTSIZ(ep) & DEPTSIZ_xfersize_bits);
+ int transfered = endpoint->len - size;
+ logf("len=%d reg=%ld xfer=%d", endpoint->len, size, transfered);
/* handle EP0 state if necessary,
* this is a ack if length is 0 */
if(ep == 0)
handle_ep0_complete(endpoint->len == 0);
+ endpoint->len = size;
usb_core_transfer_complete(ep, USB_DIR_IN, 0, transfered);
wakeup_signal(&endpoint->complete);
}
@@ -830,6 +830,6 @@ void usb_drv_stall(int ep, bool stall, bool in)
bool usb_drv_stalled(int ep, bool in)
{
- return (in ? DIEPCTL(ep) : DOEPCTL(ep)) & DEPCTL_stall ? true : false;
+ return (in ? DIEPCTL(ep) : DOEPCTL(ep)) & DEPCTL_stall;
}