diff options
-rw-r--r-- | chip/lm4/watchdog.c | 10 | ||||
-rw-r--r-- | chip/stm32/watchdog.c | 12 | ||||
-rw-r--r-- | core/cortex-m/build.mk | 1 | ||||
-rw-r--r-- | core/cortex-m/watchdog.c | 19 |
4 files changed, 20 insertions, 22 deletions
diff --git a/chip/lm4/watchdog.c b/chip/lm4/watchdog.c index 915c7e3489..2982c8b217 100644 --- a/chip/lm4/watchdog.c +++ b/chip/lm4/watchdog.c @@ -160,13 +160,3 @@ int watchdog_init(void) return EC_SUCCESS; } - - -/* Low priority task to reload the watchdog */ -void watchdog_task(void) -{ - while (1) { - usleep(WATCHDOG_RELOAD_MS * 1000); - watchdog_reload(); - } -} diff --git a/chip/stm32/watchdog.c b/chip/stm32/watchdog.c index d23d12edbe..da6079ac29 100644 --- a/chip/stm32/watchdog.c +++ b/chip/stm32/watchdog.c @@ -55,15 +55,3 @@ int watchdog_init(void) return EC_SUCCESS; } - - -/* Low priority task to reload the watchdog */ -void watchdog_task(void) -{ - while (1) { - usleep(500000); - watchdog_reload(); - usleep(500000); - watchdog_reload(); - } -} diff --git a/core/cortex-m/build.mk b/core/cortex-m/build.mk index 5abd25ba08..65d3b06551 100644 --- a/core/cortex-m/build.mk +++ b/core/cortex-m/build.mk @@ -15,3 +15,4 @@ CFLAGS_CPU+=$(CFLAGS_FPU-y) core-y=init.o panic.o switch.o task.o timer.o core-$(CONFIG_FPU)+=fpu.o +core-$(CONFIG_TASK_WATCHDOG)+=watchdog.o diff --git a/core/cortex-m/watchdog.c b/core/cortex-m/watchdog.c new file mode 100644 index 0000000000..e0a58953fb --- /dev/null +++ b/core/cortex-m/watchdog.c @@ -0,0 +1,19 @@ +/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* Watchdog common code */ + +#include "timer.h" +#include "watchdog.h" + + +/* Low priority task to reload the watchdog */ +void watchdog_task(void) +{ + while (1) { + usleep(WATCHDOG_RELOAD_MS * 1000); + watchdog_reload(); + } +} |