mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
f4 usb_dcd: disable FIFO empty IRQ while waiting for tx completion
CPU was being hammered with FIFO empty IRQs if we queued data but the host wasn't actively draining the FIFO. This was entirely unexpected so this hack should probably be removed once we can figure out why this was happening. This is almost certainly hiding some other issue.
This commit is contained in:
parent
c4bd286739
commit
3210bd3f9c
@ -670,8 +670,6 @@ static uint32_t DCD_WriteEmptyTxFifo(USB_OTG_CORE_HANDLE *pdev, uint32_t epnum)
|
||||
len32b = (len + 3) / 4;
|
||||
txstatus.d32 = USB_OTG_READ_REG32( &pdev->regs.INEP_REGS[epnum]->DTXFSTS);
|
||||
|
||||
|
||||
|
||||
while (txstatus.b.txfspcavail > len32b &&
|
||||
ep->xfer_count < ep->xfer_len &&
|
||||
ep->xfer_len != 0)
|
||||
@ -692,7 +690,14 @@ static uint32_t DCD_WriteEmptyTxFifo(USB_OTG_CORE_HANDLE *pdev, uint32_t epnum)
|
||||
|
||||
txstatus.d32 = USB_OTG_READ_REG32(&pdev->regs.INEP_REGS[epnum]->DTXFSTS);
|
||||
}
|
||||
|
||||
|
||||
if (ep->xfer_count == ep->xfer_len || ep->xfer_len == 0) {
|
||||
/* Turn off the Fifo Empty Interrupt */
|
||||
uint32_t fifoemptymsk;
|
||||
|
||||
fifoemptymsk = 0x1 << epnum;
|
||||
USB_OTG_MODIFY_REG32(&pdev->regs.DREGS->DIEPEMPMSK, fifoemptymsk, 0);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user