aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src/hal_wdg.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-06-07 13:10:04 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-06-07 13:10:04 +0000
commit02d65c01db18d4460e421242e4be82b25a723ad0 (patch)
treece0b5928a26ad79453a457f607be05d949321363 /os/hal/src/hal_wdg.c
parentafc0508c0b98188ecd6467391cd8043f0ba9ff57 (diff)
downloadChibiOS-02d65c01db18d4460e421242e4be82b25a723ad0.tar.gz
ChibiOS-02d65c01db18d4460e421242e4be82b25a723ad0.tar.bz2
ChibiOS-02d65c01db18d4460e421242e4be82b25a723ad0.zip
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
Diffstat (limited to 'os/hal/src/hal_wdg.c')
-rw-r--r--os/hal/src/hal_wdg.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/os/hal/src/hal_wdg.c b/os/hal/src/hal_wdg.c
index 1b3ec70c6..c5797e810 100644
--- a/os/hal/src/hal_wdg.c
+++ b/os/hal/src/hal_wdg.c
@@ -91,10 +91,14 @@ void wdgStop(WDGDriver *wdgp) {
osalDbgCheck(wdgp != NULL);
osalSysLock();
+
osalDbgAssert((wdgp->state == WDG_STOP) || (wdgp->state == WDG_READY),
"invalid state");
+
wdg_lld_stop(wdgp);
- wdgp->state = WDG_STOP;
+ wdgp->config = NULL;
+ wdgp->state = WDG_STOP;
+
osalSysUnlock();
}