aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src/hal_pal.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2018-02-26 09:29:02 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2018-02-26 09:29:02 +0000
commit50439eed0df5c61ecb70483ad7d999f0038f1b3d (patch)
tree017bb6e6d51502856b80d3c16e6ffb1a44548580 /os/hal/src/hal_pal.c
parent4a03cef983fcf64c8b6fbdc888dfe4b05915425e (diff)
downloadChibiOS-50439eed0df5c61ecb70483ad7d999f0038f1b3d.tar.gz
ChibiOS-50439eed0df5c61ecb70483ad7d999f0038f1b3d.tar.bz2
ChibiOS-50439eed0df5c61ecb70483ad7d999f0038f1b3d.zip
Added back missing revisions in trunk.
git-svn-id: https://svn.code.sf.net/p/chibios/svn2/trunk@11544 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os/hal/src/hal_pal.c')
-rw-r--r--os/hal/src/hal_pal.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/os/hal/src/hal_pal.c b/os/hal/src/hal_pal.c
index 1f2ced277..3861ebae3 100644
--- a/os/hal/src/hal_pal.c
+++ b/os/hal/src/hal_pal.c
@@ -181,6 +181,35 @@ msg_t palWaitPadTimeoutS(ioportid_t port,
}
/**
+ * @brief Waits for an edge on the specified port/pad.
+ *
+ * @param[in] port port identifier
+ * @param[in] pad pad number within the port
+ * @param[in] timeout the number of ticks before the operation timeouts,
+ * the following special values are allowed:
+ * - @a TIME_IMMEDIATE immediate timeout.
+ * - @a TIME_INFINITE no timeout.
+ * .
+ * @returns The operation state.
+ * @retval MSG_OK if an edge has been detected.
+ * @retval MSG_TIMEOUT if a timeout occurred before an edge cound be detected.
+ * @retval MSG_RESET if the event has been disabled while the thread was
+ * waiting for an edge.
+ *
+ * @api
+ */
+msg_t palWaitPadTimeout(ioportid_t port,
+ iopadid_t pad,
+ sysinterval_t timeout) {
+ msg_t msg;
+
+ osalSysLock();
+ msg = palWaitPadTimeoutS(port, pad, timeout);
+ osalSysUnlock();
+ return msg;
+}
+
+/**
* @brief Waits for an edge on the specified line.
*
* @param[in] line line identifier
@@ -199,6 +228,28 @@ msg_t palWaitLineTimeoutS(ioline_t line,
palevent_t *pep = pal_lld_get_line_event(line);
return osalThreadEnqueueTimeoutS(&pep->threads, timeout);
}
+
+/**
+ * @brief Waits for an edge on the specified line.
+ *
+ * @param[in] line line identifier
+ * @param[in] timeout operation timeout
+ * @returns The operation state.
+ * @retval MSG_OK if an edge has been detected.
+ * @retval MSG_TIMEOUT if a timeout occurred before an edge cound be detected.
+ * @retval MSG_RESET if the event has been disabled while the thread was
+ * waiting for an edge.
+ *
+ * @api
+ */
+msg_t palWaitLineTimeout(ioline_t line, sysinterval_t timeout) {
+ msg_t msg;
+
+ osalSysLock();
+ msg= palWaitLineTimeoutS(line, timeout);
+ osalSysUnlock();
+ return msg;
+}
#endif /* PAL_USE_WAIT == TRUE */
#endif /* HAL_USE_PAL == TRUE */