summaryrefslogtreecommitdiff
path: root/core/cortex-m/watchdog.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-06-01 21:45:36 -0700
committerGerrit <chrome-bot@google.com>2012-06-05 09:30:21 -0700
commit99845e2fd5c89f78f5d34ea5c705e6d55aba5043 (patch)
treeb807d53acbc4b91adf6fd34b7159222930a17bc3 /core/cortex-m/watchdog.c
parentfb425cf11f5a0f9ea2a1a7dc19789b328b3bc859 (diff)
downloadchrome-ec-99845e2fd5c89f78f5d34ea5c705e6d55aba5043.tar.gz
Add a common watchdog file
Some things about watchdogs are common across Cortex-M3, so create a common watchdog file to hold these. Put the watchdog task in there as the first customer. BUG=chrome-os-partner:10145 TEST=build for all boards Change-Id: Id55f71a807ee12bae3758afc213c30c731eadc07 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/24395 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'core/cortex-m/watchdog.c')
-rw-r--r--core/cortex-m/watchdog.c19
1 files changed, 19 insertions, 0 deletions
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();
+ }
+}