mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-17 00:52:38 -05:00
as3525v2-usb: fix red and fix stupid typo about endpoint status
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28029 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
f20d11c718
commit
f140930714
1 changed files with 5 additions and 13 deletions
|
|
@ -731,11 +731,9 @@ void usb_drv_cancel_all_transfers()
|
||||||
static int usb_drv_transfer(int ep, void *ptr, int len, bool dir_in, bool blocking)
|
static int usb_drv_transfer(int ep, void *ptr, int len, bool dir_in, bool blocking)
|
||||||
{
|
{
|
||||||
ep = EP_NUM(ep);
|
ep = EP_NUM(ep);
|
||||||
if(ep != 0)
|
|
||||||
{
|
logf("usb-drv: xfer EP%d, len=%d, dir_in=%d, blocking=%d", ep,
|
||||||
_logf("usb-drv: xfer EP%d, len=%d, dir_in=%d, blocking=%d", ep,
|
|
||||||
len, dir_in, blocking);
|
len, dir_in, blocking);
|
||||||
}
|
|
||||||
|
|
||||||
volatile unsigned long *epctl = dir_in ? &DIEPCTL(ep) : &DOEPCTL(ep);
|
volatile unsigned long *epctl = dir_in ? &DIEPCTL(ep) : &DOEPCTL(ep);
|
||||||
volatile unsigned long *eptsiz = dir_in ? &DIEPTSIZ(ep) : &DOEPTSIZ(ep);
|
volatile unsigned long *eptsiz = dir_in ? &DIEPTSIZ(ep) : &DOEPTSIZ(ep);
|
||||||
|
|
@ -746,19 +744,16 @@ static int usb_drv_transfer(int ep, void *ptr, int len, bool dir_in, bool blocki
|
||||||
#define DEPDMA *epdma
|
#define DEPDMA *epdma
|
||||||
|
|
||||||
if(endpoint->busy)
|
if(endpoint->busy)
|
||||||
_logf("usb-drv: EP%d %s is already busy", ep, dir_in ? "IN" : "OUT");
|
logf("usb-drv: EP%d %s is already busy", ep, dir_in ? "IN" : "OUT");
|
||||||
|
|
||||||
endpoint->busy = true;
|
endpoint->busy = true;
|
||||||
endpoint->len = len;
|
endpoint->len = len;
|
||||||
endpoint->wait = blocking;
|
endpoint->wait = blocking;
|
||||||
endpoint->status = true;
|
endpoint->status = 0;
|
||||||
|
|
||||||
DEPCTL &= ~DEPCTL_stall;
|
DEPCTL &= ~DEPCTL_stall;
|
||||||
DEPCTL |= DEPCTL_usbactep;
|
DEPCTL |= DEPCTL_usbactep;
|
||||||
|
|
||||||
if(ep != 0)
|
|
||||||
_logf("usb-drv: depctl=%lx", DEPCTL);
|
|
||||||
|
|
||||||
int mps = usb_drv_mps_by_type(extract(DEPCTL, eptype));
|
int mps = usb_drv_mps_by_type(extract(DEPCTL, eptype));
|
||||||
int nb_packets = (len + mps - 1) / mps;
|
int nb_packets = (len + mps - 1) / mps;
|
||||||
|
|
||||||
|
|
@ -778,9 +773,6 @@ static int usb_drv_transfer(int ep, void *ptr, int len, bool dir_in, bool blocki
|
||||||
|
|
||||||
DEPCTL |= DEPCTL_epena | DEPCTL_cnak;
|
DEPCTL |= DEPCTL_epena | DEPCTL_cnak;
|
||||||
|
|
||||||
if(ep != 0)
|
|
||||||
_logf("usb-drv: depctl=%lx", DEPCTL);
|
|
||||||
|
|
||||||
if(blocking)
|
if(blocking)
|
||||||
wakeup_wait(&endpoint->complete, TIMEOUT_BLOCK);
|
wakeup_wait(&endpoint->complete, TIMEOUT_BLOCK);
|
||||||
if(endpoint->status != 0)
|
if(endpoint->status != 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue