From 50439eed0df5c61ecb70483ad7d999f0038f1b3d Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Mon, 26 Feb 2018 09:29:02 +0000 Subject: Added back missing revisions in trunk. git-svn-id: https://svn.code.sf.net/p/chibios/svn2/trunk@11544 110e8d01-0319-4d1e-a829-52ad28d1bb01 --- os/hal/src/hal_pal.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'os/hal/src/hal_pal.c') 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 @@ -180,6 +180,35 @@ msg_t palWaitPadTimeoutS(ioportid_t port, return osalThreadEnqueueTimeoutS(&pep->threads, timeout); } +/** + * @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. * @@ -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 */ -- cgit v1.2.3