diff options
author | Amaury Pouly <pamaury@rockbox.org> | 2011-01-24 15:34:14 +0000 |
---|---|---|
committer | Amaury Pouly <pamaury@rockbox.org> | 2011-01-24 15:34:14 +0000 |
commit | 9b02ce9e498e8c3580a25852c17345df710b4893 (patch) | |
tree | 245a9d01800fa80c508622e691925e1c13433e9e | |
parent | 297ca4b1af2c595832e46ff7b0cd6072333cae66 (diff) |
as3525v2-usb: mask usb interrupt when setting up a transfer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29130 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/arm/as3525/usb-drv-as3525v2.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/firmware/target/arm/as3525/usb-drv-as3525v2.c b/firmware/target/arm/as3525/usb-drv-as3525v2.c index dc9e0b3949..165c0e4723 100644 --- a/firmware/target/arm/as3525/usb-drv-as3525v2.c +++ b/firmware/target/arm/as3525/usb-drv-as3525v2.c @@ -748,6 +748,9 @@ static int usb_drv_transfer(int ep, void *ptr, int len, bool dir_in, bool blocki logf("usb-drv: xfer EP%d, len=%d, dir_in=%d, blocking=%d", ep, len, dir_in, blocking); + /* mask the usb interrupt to avoid any race */ + VIC_INT_EN_CLEAR = INTERRUPT_USB; + volatile unsigned long *epctl = dir_in ? &DIEPCTL(ep) : &DOEPCTL(ep); volatile unsigned long *eptsiz = dir_in ? &DIEPTSIZ(ep) : &DOEPTSIZ(ep); volatile unsigned long *epdma = dir_in ? &DIEPDMA(ep) : &DOEPDMA(ep); @@ -789,6 +792,9 @@ static int usb_drv_transfer(int ep, void *ptr, int len, bool dir_in, bool blocki DEPCTL |= DEPCTL_epena | DEPCTL_cnak; + /* unmask the usb interrupt */ + VIC_INT_ENABLE = INTERRUPT_USB; + if(blocking) { wakeup_wait(&endpoint->complete, TIMEOUT_BLOCK); |