mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
Fix handling for pending transfers
This commit is contained in:
parent
d7cbfaaa0a
commit
03d2e32dc1
@ -269,7 +269,8 @@ static void suspend_transfer(int pipenum, buffer_descriptor_t *bd)
|
|||||||
pipe_state_t *pipe = &_hcd.pipe[pipenum];
|
pipe_state_t *pipe = &_hcd.pipe[pipenum];
|
||||||
pipe->buffer = bd->addr;
|
pipe->buffer = bd->addr;
|
||||||
pipe->data = bd->data ^ 1;
|
pipe->data = bd->data ^ 1;
|
||||||
if (TUSB_XFER_INTERRUPT == pipe->xfer) {
|
if ((TUSB_XFER_INTERRUPT == pipe->xfer) ||
|
||||||
|
(TUSB_XFER_BULK == pipe->xfer)) {
|
||||||
_hcd.pending |= TU_BIT(pipenum);
|
_hcd.pending |= TU_BIT(pipenum);
|
||||||
KHCI->INTEN |= USB_ISTAT_SOFTOK_MASK;
|
KHCI->INTEN |= USB_ISTAT_SOFTOK_MASK;
|
||||||
}
|
}
|
||||||
@ -613,6 +614,7 @@ void hcd_int_handler(uint8_t rhport)
|
|||||||
if (_hcd.pending) {
|
if (_hcd.pending) {
|
||||||
int pipenum = __builtin_ctz(_hcd.pending);
|
int pipenum = __builtin_ctz(_hcd.pending);
|
||||||
_hcd.pending = 0;
|
_hcd.pending = 0;
|
||||||
|
if (!(is & USB_ISTAT_TOKDNE_MASK))
|
||||||
resume_transfer(pipenum);
|
resume_transfer(pipenum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user