You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/09/03 01:02:17 UTC

incubator-mynewt-core git commit: MYNEWT-169; hal watchdog, add the API.

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 0f85cf5a9 -> a1a314579


MYNEWT-169; hal watchdog, add the API.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/a1a31457
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/a1a31457
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/a1a31457

Branch: refs/heads/develop
Commit: a1a314579acd411173e8a37219dcf2c01f461ece
Parents: 0f85cf5
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Fri Sep 2 18:01:14 2016 -0700
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Fri Sep 2 18:01:14 2016 -0700

----------------------------------------------------------------------
 hw/hal/include/hal/hal_watchdog.h | 55 ++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1a31457/hw/hal/include/hal/hal_watchdog.h
----------------------------------------------------------------------
diff --git a/hw/hal/include/hal/hal_watchdog.h b/hw/hal/include/hal/hal_watchdog.h
new file mode 100644
index 0000000..50f6aff
--- /dev/null
+++ b/hw/hal/include/hal/hal_watchdog.h
@@ -0,0 +1,55 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef _HAL_WATCHDOG_H_
+#define _HAL_WATCHDOG_H_
+
+/*
+ * Set a recurring watchdog timer to fire no sooner than in 'expire_secs'
+ * seconds. Watchdog should be tickled periodically with a frequency
+ * smaller than 'expire_secs'. Watchdog needs to be then started with
+ * a call to hal_watchdog_enable().
+ *
+ * @param expire_secs		Watchdog timer expiration time
+ *
+ * @return			< 0 on failure; on success return the actual
+ *                              expiration time as positive value
+ */
+int hal_watchdog_init(int expire_secs);
+
+/*
+ * Starts the watchdog.
+ *
+ * @return			0 on success; non-zero on failure.
+ */
+int hal_watchdog_enable(void);
+
+/*
+ * Stops the watchdog.
+ *
+ * @return			0 on success; non-zero on failure.
+ */
+int hal_watchdog_stop(void);
+
+/*
+ * Tickles the watchdog. Needs to be done before 'expire_secs' fires.
+ */
+void hal_watchdog_tickle(void);
+
+#endif /* _HAL_WATCHDOG_H_ */