diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/cortex-m/build.mk | 1 | ||||
-rw-r--r-- | core/cortex-m/watchdog.c | 19 |
2 files changed, 20 insertions, 0 deletions
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(); + } +} |