mirror of https://github.com/ARMmbed/mbed-os.git
[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 twicepull/2542/head
parent
00086a6f44
commit
04fe4d2588
|
|
@ -2450,6 +2450,7 @@ static void SPI_TxISR_8BIT(struct __SPI_HandleTypeDef *hspi)
|
||||||
SET_BIT(hspi->Instance->CR1, SPI_CR1_CRCNEXT);
|
SET_BIT(hspi->Instance->CR1, SPI_CR1_CRCNEXT);
|
||||||
}
|
}
|
||||||
#endif /* USE_SPI_CRC */
|
#endif /* USE_SPI_CRC */
|
||||||
|
__HAL_SPI_DISABLE_IT(hspi, (SPI_IT_TXE));
|
||||||
SPI_CloseTx_ISR(hspi);
|
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);
|
SET_BIT(hspi->Instance->CR1, SPI_CR1_CRCNEXT);
|
||||||
}
|
}
|
||||||
#endif /* USE_SPI_CRC */
|
#endif /* USE_SPI_CRC */
|
||||||
|
__HAL_SPI_DISABLE_IT(hspi, (SPI_IT_TXE));
|
||||||
SPI_CloseTx_ISR(hspi);
|
SPI_CloseTx_ISR(hspi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue