Skip to content

Commit

Permalink
KL27Z: Fix duplicate define error
Browse files Browse the repository at this point in the history
Signed-off-by: Mahadevan Mahesh <[email protected]>
  • Loading branch information
mmahadevan108 committed Aug 9, 2016
1 parent 91ff73d commit a7a6521
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static void FLEXIO_SPI_DMAConfig(FLEXIO_SPI_Type *base,
******************************************************************************/

/* Dummy data used to send */
const uint16_t s_dummyData = FLEXIO_SPI_DUMMYDATA;
static const uint16_t s_dummyData = FLEXIO_SPI_DUMMYDATA;

/*< @brief user configurable flexio spi handle count. */
#define FLEXIO_SPI_HANDLE_COUNT 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
* @{
*/

/*! @file */

/*******************************************************************************
* Definitions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static void SPI_RxDMACallback(dma_handle_t *handle, void *userData);
******************************************************************************/

/* Dummy data used to send */
const uint8_t s_dummyData = SPI_DUMMYDATA;
static const uint8_t s_dummyData = SPI_DUMMYDATA;

/*******************************************************************************
* Code
Expand Down Expand Up @@ -168,7 +168,7 @@ void SPI_MasterTransferCreateHandleDMA(SPI_Type *base,
handle->bytesPerFrame = 1U;
#endif /* FSL_FEATURE_SPI_16BIT_TRANSFERS */

#if defined(FSL_FEATURE_SPI_FIFO_SIZE) && (FSL_FEATURE_SPI_FIFO_SIZE > 1)
#if defined(FSL_FEATURE_SPI_HAS_FIFO) && (FSL_FEATURE_SPI_HAS_FIFO)
/* If using DMA, disable FIFO, as the FIFO may cause data loss if the data size is not integer
times of 2bytes. As SPI cannot set watermark to 0, only can set to 1/2 FIFO size or 3/4 FIFO
size. */
Expand All @@ -177,7 +177,7 @@ void SPI_MasterTransferCreateHandleDMA(SPI_Type *base,
base->C3 &= ~SPI_C3_FIFOMODE_MASK;
}

#endif /* FSL_FEATURE_SPI_FIFO_SIZE */
#endif /* FSL_FEATURE_SPI_HAS_FIFO */

/* Set the non-change attribute for Tx DMA transfer, to improve efficiency */
config.destAddr = SPI_GetDataRegisterAddress(base);
Expand Down Expand Up @@ -226,6 +226,10 @@ status_t SPI_MasterTransferDMA(SPI_Type *base, spi_dma_handle_t *handle, spi_tra
return kStatus_InvalidArgument;
}

/* Disable SPI and then enable it, this is used to clear S register*/
SPI_Enable(base, false);
SPI_Enable(base, true);

/* Configure tx transfer DMA */
config.destAddr = SPI_GetDataRegisterAddress(base);
config.enableDestIncrement = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
* @{
*/

/*! @file */

/*******************************************************************************
* Definitions
Expand Down

0 comments on commit a7a6521

Please sign in to comment.