mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
USB AMSv2: split handle_ep_int()
IN & OUT interrupts have not much in common so move each to its own function git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28043 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
5aa5de5dc8
commit
f1adafc05a
1 changed files with 89 additions and 89 deletions
|
|
@ -461,11 +461,9 @@ void usb_drv_exit(void)
|
|||
cpu_boost(0);
|
||||
}
|
||||
|
||||
static void handle_ep_int(int ep, bool dir_in)
|
||||
static void handle_ep_in_int(int ep)
|
||||
{
|
||||
struct usb_endpoint *endpoint = &endpoints[ep][dir_in];
|
||||
if(dir_in)
|
||||
{
|
||||
struct usb_endpoint *endpoint = &endpoints[ep][DIR_IN];
|
||||
unsigned long sts = DIEPINT(ep);
|
||||
if(sts & DIEPINT_ahberr)
|
||||
panicf("usb-drv: ahb error on EP%d IN", ep);
|
||||
|
|
@ -503,9 +501,11 @@ static void handle_ep_int(int ep, bool dir_in)
|
|||
}
|
||||
/* clear interrupts */
|
||||
DIEPINT(ep) = sts;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
static void handle_ep_out_int(int ep)
|
||||
{
|
||||
struct usb_endpoint *endpoint = &endpoints[ep][DIR_OUT];
|
||||
unsigned long sts = DOEPINT(ep);
|
||||
if(sts & DOEPINT_ahberr)
|
||||
panicf("usb-drv: ahb error on EP%d OUT", ep);
|
||||
|
|
@ -556,7 +556,6 @@ static void handle_ep_int(int ep, bool dir_in)
|
|||
}
|
||||
/* clear interrupts */
|
||||
DOEPINT(ep) = sts;
|
||||
}
|
||||
}
|
||||
|
||||
static void handle_ep_ints(void)
|
||||
|
|
@ -568,10 +567,11 @@ static void handle_ep_ints(void)
|
|||
|
||||
FOR_EACH_IN_EP_AND_EP0(i, ep)
|
||||
if(daint & DAINT_IN_EP(ep))
|
||||
handle_ep_int(ep, true);
|
||||
handle_ep_in_int(ep);
|
||||
|
||||
FOR_EACH_OUT_EP_AND_EP0(i, ep)
|
||||
if(daint & DAINT_OUT_EP(ep))
|
||||
handle_ep_int(ep, false);
|
||||
handle_ep_out_int(ep);
|
||||
|
||||
/* write back to clear status */
|
||||
DAINT = daint;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue