From d98c4ad116c4b80d8c70ff20192988dc0ad849c2 Mon Sep 17 00:00:00 2001 From: xx Date: Thu, 29 Mar 2018 15:39:31 +0800 Subject: [PATCH] =?UTF-8?q?[imx=20rt1050]=E4=BF=AE=E6=94=B9sai=20edma?= =?UTF-8?q?=E9=A9=B1=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/imxrt1052-evk/Libraries/drivers/fsl_sai_edma.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bsp/imxrt1052-evk/Libraries/drivers/fsl_sai_edma.c b/bsp/imxrt1052-evk/Libraries/drivers/fsl_sai_edma.c index c48a5aacd1..216b6e3fab 100644 --- a/bsp/imxrt1052-evk/Libraries/drivers/fsl_sai_edma.c +++ b/bsp/imxrt1052-evk/Libraries/drivers/fsl_sai_edma.c @@ -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; }