From 17e08c79399805967ddf17f5793e61e8b9196eb5 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 31 Oct 2021 06:02:45 +0000 Subject: [PATCH] Added an abort on overflow error. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14972 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/hal/ports/STM32/LLD/SPIv3/hal_spi_v2_lld.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/os/hal/ports/STM32/LLD/SPIv3/hal_spi_v2_lld.c b/os/hal/ports/STM32/LLD/SPIv3/hal_spi_v2_lld.c index 53b93f54c..889925009 100644 --- a/os/hal/ports/STM32/LLD/SPIv3/hal_spi_v2_lld.c +++ b/os/hal/ports/STM32/LLD/SPIv3/hal_spi_v2_lld.c @@ -354,7 +354,12 @@ static void spi_lld_serve_interrupt(SPIDriver *spip) { spip->spi->IFCR = sr; if ((sr & SPI_SR_OVR) != 0U) { - /* TODO: fault notification.*/ + + /* Aborting the transfer.*/ + spi_lld_stop_abort(spip); + + /* Reporting the failure.*/ + __spi_isr_error_code(spip, HAL_RET_HW_FAILURE); } }