Skip to content

Commit 4df67ef

Browse files
jeromecoutantadbridge
authored andcommitted
STM32 SPI ASYNC - Add FIFO flush before transfer
1 parent a52d755 commit 4df67ef

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

targets/TARGET_STM/stm_spi_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,11 @@ static int spi_master_start_asynch_transfer(spi_t *obj, transfer_type_t transfer
526526
NVIC_SetPriority(irq_n, 1);
527527
NVIC_EnableIRQ(irq_n);
528528

529+
// flush FIFO
530+
#if defined(SPI_FLAG_FRLVL) // STM32F0 STM32F3 STM32F7 STM32L4
531+
HAL_SPIEx_FlushRxFifo(handle);
532+
#endif
533+
529534
// enable the right hal transfer
530535
int rc = 0;
531536
switch(transfer_type) {

0 commit comments

Comments
 (0)