修正iis驱动

This commit is contained in:
heyuanjie 2018-04-01 17:49:39 +08:00
parent 38fc71608d
commit aa86f7f7bb
2 changed files with 3 additions and 2 deletions

View File

@ -99,7 +99,7 @@ static void SAI_TxEDMACallback(edma_handle_t *handle, void *userData, bool done,
saiHandle->queueDriver = (saiHandle->queueDriver + 1) % SAI_XFER_QUEUE_SIZE;
/* If all data finished, just stop the transfer */
if (saiHandle->saiQueue[saiHandle->queueDriver].data == NULL)
if (saiHandle->saiQueue[saiHandle->queueDriver].dataSize == 0)
{
/* Disable DMA enable bit */
SAI_TxEnableDMA(privHandle->base, kSAI_FIFORequestDMAEnable, false);

View File

@ -347,7 +347,8 @@ static rt_size_t icodec_transmit(struct rt_audio_device *audio, const void *writ
xfer.data = (uint8_t *)writeBuf;
xfer.dataSize = size;
SAI_TransferSendEDMA(icodec->sai, &icodec->txHandle, &xfer);
if (SAI_TransferSendEDMA(icodec->sai, &icodec->txHandle, &xfer) != kStatus_Success)
return 0;
return size;
}