diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-01-20 12:26:50 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-01-20 12:26:50 +0000 |
commit | 151ca1d309f2d350527a73676c5aa47f5c2fa921 (patch) | |
tree | c82b2f25a3558cb7171b9eec7ec7229673f806a0 /os/hal/src | |
parent | 841ab0b70ee492a215cb5fab48b60df40b9d8f5d (diff) | |
download | ChibiOS-151ca1d309f2d350527a73676c5aa47f5c2fa921.tar.gz ChibiOS-151ca1d309f2d350527a73676c5aa47f5c2fa921.tar.bz2 ChibiOS-151ca1d309f2d350527a73676c5aa47f5c2fa921.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6634 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src')
-rw-r--r-- | os/hal/src/st.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/os/hal/src/st.c b/os/hal/src/st.c index f2e8f3bf2..afb4466fa 100644 --- a/os/hal/src/st.c +++ b/os/hal/src/st.c @@ -66,6 +66,71 @@ void stInit(void) { st_lld_init();
}
+
+/**
+ * @brief Starts the alarm.
+ * @note Makes sure that no spurious alarms are triggered after
+ * this call.
+ * @note This functionality is only available in free running mode, the
+ * behavior in periodic mode is undefined.
+ *
+ * @param[in] time the time to be set for the first alarm
+ *
+ * @api
+ */
+void stStartAlarm(systime_t time) {
+
+ osalDbgAssert(stIsAlarmActive() == false, "already active");
+
+ st_lld_start_alarm(time);
+}
+
+/**
+ * @brief Stops the alarm interrupt.
+ * @note This functionality is only available in free running mode, the
+ * behavior in periodic mode is undefined.
+ *
+ * @api
+ */
+void stStopAlarm(void) {
+
+ osalDbgAssert(stIsAlarmActive() != false, "not active");
+
+ st_lld_stop_alarm();
+}
+
+/**
+ * @brief Sets the alarm time.
+ * @note This functionality is only available in free running mode, the
+ * behavior in periodic mode is undefined.
+ *
+ * @param[in] time the time to be set for the next alarm
+ *
+ * @api
+ */
+void stSetAlarm(systime_t time) {
+
+ osalDbgAssert(stIsAlarmActive() != false, "not active");
+
+ st_lld_set_alarm(time);
+}
+
+/**
+ * @brief Returns the current alarm time.
+ * @note This functionality is only available in free running mode, the
+ * behavior in periodic mode is undefined.
+ *
+ * @return The currently set alarm time.
+ *
+ * @api
+ */
+systime_t stGetAlarm(void) {
+
+ osalDbgAssert(stIsAlarmActive() != false, "not active");
+
+ return st_lld_get_alarm();
+}
+
#endif /* OSAL_ST_MODE != OSAL_ST_MODE_NONE */
/** @} */
|