From 6bf335166f8202267735161440202628b929a350 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Thu, 15 Aug 2024 12:34:22 +0200 Subject: [PATCH] fix: SPI word transfer (#5436) Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com> --- radio/src/targets/common/arm/stm32/stm32_spi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/common/arm/stm32/stm32_spi.cpp b/radio/src/targets/common/arm/stm32/stm32_spi.cpp index 9871f1c0b..c20a0935f 100644 --- a/radio/src/targets/common/arm/stm32/stm32_spi.cpp +++ b/radio/src/targets/common/arm/stm32/stm32_spi.cpp @@ -291,9 +291,9 @@ uint16_t stm32_spi_transfer_word(const stm32_spi_t* spi, uint16_t out) LL_SPI_TransmitData16(SPIx, out); #if defined(STM32H7) || defined(STM32H7RS) - while (!LL_SPI_IsActiveFlag_TXP(SPIx)); + while (!LL_SPI_IsActiveFlag_RXP(SPIx)); #else - while (!LL_SPI_IsActiveFlag_TXE(SPIx)); + while (!LL_SPI_IsActiveFlag_RXNE(SPIx)); #endif return LL_SPI_ReceiveData16(SPIx); }