[imx rt1050]修改sai edma驱动

This commit is contained in:
xx 2018-03-29 15:39:31 +08:00
parent e0314e637e
commit d98c4ad116
1 changed files with 3 additions and 3 deletions

View File

@ -91,11 +91,11 @@ 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 */
saiHandle->saiQueue[saiHandle->queueDriver].dataSize = 0;
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 */
@ -264,7 +264,7 @@ status_t SAI_TransferSendEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_tra
return kStatus_InvalidArgument;
}
if (handle->saiQueue[handle->queueUser].data)
if (handle->saiQueue[handle->queueUser].dataSize)
{
return kStatus_SAI_QueueFull;
}