Skip to content

Commit 9ad6e7a

Browse files
committed
drivers: spi: stm32: fix full duplex asynchronous transfer
For an asynchronous transfer, the driver was waiting until transfer was ended to leave the transceive function, which defeated the purpose of async. Restore previous behavior. The transfer is still blocking for half duplex though. Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
1 parent 54f586f commit 9ad6e7a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎drivers/spi/spi_stm32.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,8 @@ static int transceive(const struct device *dev,
14211421
ret = spi_stm32_half_duplex_switch_to_receive(cfg, data);
14221422
transfer_dir = LL_SPI_GetTransferDirection(spi);
14231423
}
1424-
} while (ret == 0 && spi_stm32_transfer_ongoing(data));
1424+
} while (ret == 0 && spi_stm32_transfer_ongoing(data) &&
1425+
transfer_dir != LL_SPI_FULL_DUPLEX);
14251426
#else /* CONFIG_SPI_STM32_INTERRUPT */
14261427
while (ret == 0 && spi_stm32_transfer_ongoing(data)) {
14271428
ret = spi_stm32_shift_frames(cfg, data);

0 commit comments

Comments
 (0)