diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2010-09-08 05:04:48 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-09-08 05:04:48 +0000 |
commit | 8e0ff81d6f64554d762a237c75f1673a28480693 (patch) | |
tree | 6de3658d1398a062ba9355adbb1ab532ea96faa0 | |
parent | 1752dfda1b028a52208d99835219f91a850ebc0e (diff) | |
download | rockbox-8e0ff81d6f64554d762a237c75f1673a28480693.tar.gz rockbox-8e0ff81d6f64554d762a237c75f1673a28480693.zip |
USB AMSv2: only read endpoint interrupt status register once
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28041 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/arm/as3525/usb-drv-as3525v2.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/firmware/target/arm/as3525/usb-drv-as3525v2.c b/firmware/target/arm/as3525/usb-drv-as3525v2.c index 5c1a062ede..9741a7b453 100644 --- a/firmware/target/arm/as3525/usb-drv-as3525v2.c +++ b/firmware/target/arm/as3525/usb-drv-as3525v2.c @@ -466,9 +466,10 @@ static void handle_ep_int(int ep, bool dir_in) struct usb_endpoint *endpoint = &endpoints[ep][dir_in]; if(dir_in) { - if(DIEPINT(ep) & DIEPINT_ahberr) + unsigned long sts = DIEPINT(ep); + if(sts & DIEPINT_ahberr) panicf("usb-drv: ahb error on EP%d IN", ep); - if(DIEPINT(ep) & DIEPINT_xfercompl) + if(sts & DIEPINT_xfercompl) { if(endpoint->busy) { @@ -487,7 +488,7 @@ static void handle_ep_int(int ep, bool dir_in) wakeup_signal(&endpoint->complete); } } - if(DIEPINT(ep) & DIEPINT_timeout) + if(sts & DIEPINT_timeout) { panicf("usb-drv: timeout on EP%d IN", ep); if(endpoint->busy) @@ -501,13 +502,14 @@ static void handle_ep_int(int ep, bool dir_in) } } /* clear interrupts */ - DIEPINT(ep) = DIEPINT(ep); + DIEPINT(ep) = sts; } else { - if(DOEPINT(ep) & DOEPINT_ahberr) + unsigned long sts = DOEPINT(ep); + if(sts & DOEPINT_ahberr) panicf("usb-drv: ahb error on EP%d OUT", ep); - if(DOEPINT(ep) & DOEPINT_xfercompl) + if(sts & DOEPINT_xfercompl) { logf("usb-drv: xfer complete on EP%d OUT", ep); if(endpoint->busy) @@ -527,7 +529,7 @@ static void handle_ep_int(int ep, bool dir_in) wakeup_signal(&endpoint->complete); } } - if(DOEPINT(ep) & DOEPINT_setup) + if(sts & DOEPINT_setup) { logf("usb-drv: setup on EP%d OUT", ep); if(ep != 0) @@ -553,7 +555,7 @@ static void handle_ep_int(int ep, bool dir_in) } } /* clear interrupts */ - DOEPINT(ep) = DOEPINT(ep); + DOEPINT(ep) = sts; } } |