[STM32F4 HAL] Avoid SPI spurious interrupt

If SPI TXE is not disabled at the end of transfer, MBED application
callback that is registered for transfer completion might be called twice
pull/2542/head
Laurent MEUNIER 2016-09-13 17:02:30 +02:00
parent 00086a6f44
commit 04fe4d2588
1 changed files with 2 additions and 0 deletions

View File

@ -2450,6 +2450,7 @@ static void SPI_TxISR_8BIT(struct __SPI_HandleTypeDef *hspi)
SET_BIT(hspi->Instance->CR1, SPI_CR1_CRCNEXT);
}
#endif /* USE_SPI_CRC */
__HAL_SPI_DISABLE_IT(hspi, (SPI_IT_TXE));
SPI_CloseTx_ISR(hspi);
}
}
@ -2476,6 +2477,7 @@ static void SPI_TxISR_16BIT(struct __SPI_HandleTypeDef *hspi)
SET_BIT(hspi->Instance->CR1, SPI_CR1_CRCNEXT);
}
#endif /* USE_SPI_CRC */
__HAL_SPI_DISABLE_IT(hspi, (SPI_IT_TXE));
SPI_CloseTx_ISR(hspi);
}
}