[imx-rt]在回调函数执行后才清除本次传输信息

This commit is contained in:
xx 2018-03-28 12:27:04 +08:00
parent fa09a700c1
commit 5e477ae0ac
1 changed files with 3 additions and 3 deletions

View File

@ -91,12 +91,12 @@ static void SAI_TxEDMACallback(edma_handle_t *handle, void *userData, bool done,
sai_edma_handle_t *saiHandle = privHandle->handle;
/* If finished a blcok, call the callback function */
memset(&saiHandle->saiQueue[saiHandle->queueDriver], 0, sizeof(sai_transfer_t));
saiHandle->queueDriver = (saiHandle->queueDriver + 1) % SAI_XFER_QUEUE_SIZE;
if (saiHandle->callback)
{
(saiHandle->callback)(privHandle->base, saiHandle, kStatus_SAI_TxIdle, saiHandle->userData);
}
}
memset(&saiHandle->saiQueue[saiHandle->queueDriver], 0, sizeof(sai_transfer_t));
saiHandle->queueDriver = (saiHandle->queueDriver + 1) % SAI_XFER_QUEUE_SIZE;
/* If all data finished, just stop the transfer */
if (saiHandle->saiQueue[saiHandle->queueDriver].data == NULL)