Merge pull request #1946 from kasjer/kasjer/nrf5x-fix-iso-memory-corruption

dcd_nrf5x: ISO OUT handling
This commit is contained in:
Ha Thach 2023-03-11 08:06:17 +07:00 committed by GitHub
commit b5b2fad5fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

@ -187,11 +187,16 @@ static void xact_out_dma(uint8_t epnum)
}
else
{
// Trigger DMA move data from Endpoint -> SRAM
NRF_USBD->ISOOUT.PTR = (uint32_t) xfer->buffer;
NRF_USBD->ISOOUT.MAXCNT = xact_len;
if (xfer->started)
{
// Trigger DMA move data from Endpoint -> SRAM
NRF_USBD->ISOOUT.PTR = (uint32_t) xfer->buffer;
NRF_USBD->ISOOUT.MAXCNT = xact_len;
start_dma(&NRF_USBD->TASKS_STARTISOOUT);
start_dma(&NRF_USBD->TASKS_STARTISOOUT);
} else {
atomic_flag_clear(&_dcd.dma_running);
}
}
}
else