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_serial.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'os/hal/src/hal_serial.c') diff --git a/os/hal/src/hal_serial.c b/os/hal/src/hal_serial.c index 0b578fdc4..5439245ed 100644 --- a/os/hal/src/hal_serial.c +++ b/os/hal/src/hal_serial.c @@ -170,13 +170,17 @@ void sdStop(SerialDriver *sdp) { osalDbgCheck(sdp != NULL); osalSysLock(); + osalDbgAssert((sdp->state == SD_STOP) || (sdp->state == SD_READY), "invalid state"); + sd_lld_stop(sdp); - sdp->state = SD_STOP; + sdp->config = NULL; + sdp->state = SD_STOP; oqResetI(&sdp->oqueue); iqResetI(&sdp->iqueue); osalOsRescheduleS(); + osalSysUnlock(); } -- cgit v1.2.3