aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src/hal_spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/src/hal_spi.c')
-rw-r--r--os/hal/src/hal_spi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/os/hal/src/hal_spi.c b/os/hal/src/hal_spi.c
index 86bd78677..a16b61591 100644
--- a/os/hal/src/hal_spi.c
+++ b/os/hal/src/hal_spi.c
@@ -115,10 +115,14 @@ void spiStop(SPIDriver *spip) {
osalDbgCheck(spip != NULL);
osalSysLock();
+
osalDbgAssert((spip->state == SPI_STOP) || (spip->state == SPI_READY),
"invalid state");
+
spi_lld_stop(spip);
- spip->state = SPI_STOP;
+ spip->config = NULL;
+ spip->state = SPI_STOP;
+
osalSysUnlock();
}