mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 20:55:17 -05:00
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
This commit is contained in:
parent
9503e6ede3
commit
dbea731503
1 changed files with 5 additions and 5 deletions
|
|
@ -481,14 +481,14 @@ static void handle_ep_int(int ep, bool dir_in)
|
||||||
endpoint->busy = false;
|
endpoint->busy = false;
|
||||||
endpoint->status = 0;
|
endpoint->status = 0;
|
||||||
/* works even for EP0 */
|
/* works even for EP0 */
|
||||||
int transfered = endpoint->len - (DIEPTSIZ(ep) & DEPTSIZ_xfersize_bits);
|
int size = (DIEPTSIZ(ep) & DEPTSIZ_xfersize_bits);
|
||||||
logf("len=%d reg=%ld xfer=%d", endpoint->len,
|
int transfered = endpoint->len - size;
|
||||||
(DIEPTSIZ(ep) & DEPTSIZ_xfersize_bits),
|
logf("len=%d reg=%ld xfer=%d", endpoint->len, size, transfered);
|
||||||
transfered);
|
|
||||||
/* handle EP0 state if necessary,
|
/* handle EP0 state if necessary,
|
||||||
* this is a ack if length is 0 */
|
* this is a ack if length is 0 */
|
||||||
if(ep == 0)
|
if(ep == 0)
|
||||||
handle_ep0_complete(endpoint->len == 0);
|
handle_ep0_complete(endpoint->len == 0);
|
||||||
|
endpoint->len = size;
|
||||||
usb_core_transfer_complete(ep, USB_DIR_IN, 0, transfered);
|
usb_core_transfer_complete(ep, USB_DIR_IN, 0, transfered);
|
||||||
wakeup_signal(&endpoint->complete);
|
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)
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue