mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
Update sam_udphs.c
This commit is contained in:
@@ -2374,11 +2374,6 @@ static void sam_dma_interrupt(struct sam_usbdev_s *priv, int epno)
|
||||
|
||||
privep = &priv->eplist[epno];
|
||||
|
||||
/* Get the request from the head of the endpoint request queue */
|
||||
|
||||
privreq = sam_rqpeek(&privep->reqq);
|
||||
DEBUGASSERT(privreq);
|
||||
|
||||
/* Get the result of the DMA operation */
|
||||
|
||||
dmastatus = sam_getreg(SAM_UDPHS_DMASTATUS(epno));
|
||||
@@ -2439,7 +2434,12 @@ static void sam_dma_interrupt(struct sam_usbdev_s *priv, int epno)
|
||||
}
|
||||
else if (privep->epstate == UDPHS_EPSTATE_RECEIVING)
|
||||
{
|
||||
/* privreg->inflight holds the total transfer size */
|
||||
/* privreg->inflight holds the total transfer size
|
||||
* Get the request from the head of the endpoint request queue
|
||||
*/
|
||||
|
||||
privreq = sam_rqpeek(&privep->reqq);
|
||||
DEBUGASSERT(privreq);
|
||||
|
||||
xfrsize = privreq->inflight;
|
||||
privreq->inflight = 0;
|
||||
@@ -2495,8 +2495,13 @@ static void sam_dma_interrupt(struct sam_usbdev_s *priv, int epno)
|
||||
* BUFF_COUNT should not be zero. BUFF_COUNT was set to the
|
||||
* 'inflight' count when the DMA started so the difference will
|
||||
* give us the actual size of the transfer.
|
||||
*
|
||||
* Get the request from the head of the endpoint request queue first.
|
||||
*/
|
||||
|
||||
privreq = sam_rqpeek(&privep->reqq);
|
||||
DEBUGASSERT(privreq);
|
||||
|
||||
bufcnt = ((dmastatus & UDPHS_DMASTATUS_BUFCNT_MASK)
|
||||
>> UDPHS_DMASTATUS_BUFCNT_SHIFT);
|
||||
xfrsize = privreq->inflight - bufcnt;
|
||||
|
||||
Reference in New Issue
Block a user