Skip to content

Commit 8c99bf3

Browse files
committed
SPI: HAL: disable IP at the end of transmit
in case of 1LINE direction
1 parent 6dfafc7 commit 8c99bf3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

targets/TARGET_STM/TARGET_STM32L4/device/stm32l4xx_hal_spi.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,10 @@ HAL_StatusTypeDef HAL_SPI_Transmit(SPI_HandleTypeDef *hspi, uint8_t *pData, uint
655655
hspi->ErrorCode = HAL_SPI_ERROR_FLAG;
656656
}
657657

658+
if (hspi->Init.Direction == SPI_DIRECTION_1LINE) {
659+
__HAL_SPI_DISABLE(hspi);
660+
}
661+
658662
/* Clear overrun flag in 2 Lines communication mode because received is not read */
659663
if (hspi->Init.Direction == SPI_DIRECTION_2LINES)
660664
{

0 commit comments

Comments
 (0)