Skip to content

Commit 0b74dc1

Browse files
authored
Merge pull request #2400 from NXPmicro/Fix_Duplicate_Define_KL27Z
KL27Z: Fix duplicate define error
2 parents b03411c + a7a6521 commit 0b74dc1

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

hal/targets/hal/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_KL27Z/drivers/fsl_flexio_spi_dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static void FLEXIO_SPI_DMAConfig(FLEXIO_SPI_Type *base,
7777
******************************************************************************/
7878

7979
/* Dummy data used to send */
80-
const uint16_t s_dummyData = FLEXIO_SPI_DUMMYDATA;
80+
static const uint16_t s_dummyData = FLEXIO_SPI_DUMMYDATA;
8181

8282
/*< @brief user configurable flexio spi handle count. */
8383
#define FLEXIO_SPI_HANDLE_COUNT 2

hal/targets/hal/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_KL27Z/drivers/fsl_flexio_spi_dma.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
* @{
3939
*/
4040

41-
/*! @file */
4241

4342
/*******************************************************************************
4443
* Definitions

hal/targets/hal/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_KL27Z/drivers/fsl_spi_dma.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static void SPI_RxDMACallback(dma_handle_t *handle, void *userData);
8080
******************************************************************************/
8181

8282
/* Dummy data used to send */
83-
const uint8_t s_dummyData = SPI_DUMMYDATA;
83+
static const uint8_t s_dummyData = SPI_DUMMYDATA;
8484

8585
/*******************************************************************************
8686
* Code
@@ -168,7 +168,7 @@ void SPI_MasterTransferCreateHandleDMA(SPI_Type *base,
168168
handle->bytesPerFrame = 1U;
169169
#endif /* FSL_FEATURE_SPI_16BIT_TRANSFERS */
170170

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

180-
#endif /* FSL_FEATURE_SPI_FIFO_SIZE */
180+
#endif /* FSL_FEATURE_SPI_HAS_FIFO */
181181

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

229+
/* Disable SPI and then enable it, this is used to clear S register*/
230+
SPI_Enable(base, false);
231+
SPI_Enable(base, true);
232+
229233
/* Configure tx transfer DMA */
230234
config.destAddr = SPI_GetDataRegisterAddress(base);
231235
config.enableDestIncrement = false;

hal/targets/hal/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_KL27Z/drivers/fsl_spi_dma.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
* @{
3939
*/
4040

41-
/*! @file */
4241

4342
/*******************************************************************************
4443
* Definitions

0 commit comments

Comments
 (0)