From 02d65c01db18d4460e421242e4be82b25a723ad0 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Tue, 7 Jun 2016 13:10:04 +0000 Subject: Configuration cleanup on stop in the entire HAL. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9601 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/src/hal_i2s.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'os/hal/src/hal_i2s.c') diff --git a/os/hal/src/hal_i2s.c b/os/hal/src/hal_i2s.c index 2434e8477..e34068bf5 100644 --- a/os/hal/src/hal_i2s.c +++ b/os/hal/src/hal_i2s.c @@ -104,10 +104,14 @@ void i2sStop(I2SDriver *i2sp) { osalDbgCheck(i2sp != NULL); osalSysLock(); + osalDbgAssert((i2sp->state == I2S_STOP) || (i2sp->state == I2S_READY), "invalid state"); + i2s_lld_stop(i2sp); - i2sp->state = I2S_STOP; + i2sp->config = NULL; + i2sp->state = I2S_STOP; + osalSysUnlock(); } -- cgit v1.2.3