[imx rt1050]修改sai edma驱动
This commit is contained in:
parent
e0314e637e
commit
d98c4ad116
|
@ -91,11 +91,11 @@ static void SAI_TxEDMACallback(edma_handle_t *handle, void *userData, bool done,
|
||||||
sai_edma_handle_t *saiHandle = privHandle->handle;
|
sai_edma_handle_t *saiHandle = privHandle->handle;
|
||||||
|
|
||||||
/* If finished a blcok, call the callback function */
|
/* If finished a blcok, call the callback function */
|
||||||
|
saiHandle->saiQueue[saiHandle->queueDriver].dataSize = 0;
|
||||||
if (saiHandle->callback)
|
if (saiHandle->callback)
|
||||||
{
|
{
|
||||||
(saiHandle->callback)(privHandle->base, saiHandle, kStatus_SAI_TxIdle, saiHandle->userData);
|
(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;
|
saiHandle->queueDriver = (saiHandle->queueDriver + 1) % SAI_XFER_QUEUE_SIZE;
|
||||||
|
|
||||||
/* If all data finished, just stop the transfer */
|
/* 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;
|
return kStatus_InvalidArgument;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (handle->saiQueue[handle->queueUser].data)
|
if (handle->saiQueue[handle->queueUser].dataSize)
|
||||||
{
|
{
|
||||||
return kStatus_SAI_QueueFull;
|
return kStatus_SAI_QueueFull;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue