aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/osal
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-08-19 11:45:52 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-08-19 11:45:52 +0000
commitc3b9392212cb43a5496c80f3d2ab61ce4caf1dab (patch)
treec80a98cde7cba0c4d4d97e527211701a3f5dcd83 /os/hal/osal
parentb4e2fca4a0ff8ed15625cdbf57cb4e8fe90c7647 (diff)
downloadChibiOS-c3b9392212cb43a5496c80f3d2ab61ce4caf1dab.tar.gz
ChibiOS-c3b9392212cb43a5496c80f3d2ab61ce4caf1dab.tar.bz2
ChibiOS-c3b9392212cb43a5496c80f3d2ab61ce4caf1dab.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6175 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/osal')
-rw-r--r--os/hal/osal/chibios/osal.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/os/hal/osal/chibios/osal.h b/os/hal/osal/chibios/osal.h
index 4114ddfc9..d3d2e2b40 100644
--- a/os/hal/osal/chibios/osal.h
+++ b/os/hal/osal/chibios/osal.h
@@ -383,7 +383,6 @@ static inline void osalSysUnlockFromISR(void) {
chSysUnlockFromISR();
}
-#if CH_PORT_SUPPORTS_RT || defined(__DOXYGEN__)
/**
* @brief Polled delay.
* @note The real delay is always few cycles in excess of the specified
@@ -393,6 +392,7 @@ static inline void osalSysUnlockFromISR(void) {
*
* @xclass
*/
+#if CH_PORT_SUPPORTS_RT || defined(__DOXYGEN__)
static inline void osalSysPolledDelayX(rtcnt_t cycles) {
chSysPolledDelayX(cycles);
@@ -510,7 +510,32 @@ static inline void osalThreadSleep(systime_t time) {
*/
static inline msg_t osalThreadSuspendS(thread_reference_t *trp) {
- return osalThreadSuspendS(trp);
+ return chThreadSuspendS(trp);
+}
+
+/**
+ * @brief Sends the current thread sleeping and sets a reference variable.
+ * @note This function must reschedule, it can only be called from thread
+ * context.
+ *
+ * @param[in] trp a pointer to a thread reference object
+ * @param[in] timeout the timeout in system ticks, the special values are
+ * handled as follow:
+ * - @a TIME_INFINITE the thread enters an infinite sleep
+ * state.
+ * - @a TIME_IMMEDIATE the thread is not enqueued and
+ * the function returns @p MSG_TIMEOUT as if a timeout
+ * occurred.
+ * .
+ * @return The wake up message.
+ * @retval MSG_TIMEOUT if the operation timed out.
+ *
+ * @sclass
+ */
+static inline msg_t osalThreadSuspendTimeoutS(thread_reference_t *trp,
+ systime_t timeout) {
+
+ return chThreadSuspendTimeoutS(trp, timeout);
}
/**