aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/include
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-10-05 12:19:05 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-10-05 12:19:05 +0000
commitba87fbf88a47712a1cac9c86cd670417a132b719 (patch)
treee10f441c2b0de3ecb9e9b4be16fca13ac3cc6cfb /os/rt/include
parentc4da45f2fbc0d86d90c7dc74120fc61e3871fb04 (diff)
downloadChibiOS-ba87fbf88a47712a1cac9c86cd670417a132b719.tar.gz
ChibiOS-ba87fbf88a47712a1cac9c86cd670417a132b719.tar.bz2
ChibiOS-ba87fbf88a47712a1cac9c86cd670417a132b719.zip
Added chThdGetIdleX() API.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7365 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/include')
-rw-r--r--os/rt/include/chthreads.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/os/rt/include/chthreads.h b/os/rt/include/chthreads.h
index fa093b09c..a86a4c7ec 100644
--- a/os/rt/include/chthreads.h
+++ b/os/rt/include/chthreads.h
@@ -277,6 +277,25 @@ static inline thread_t *chThdGetSelfX(void) {
return ch.rlist.r_current;
}
+#if !CH_CFG_NO_IDLE_THREAD || defined(__DOXYGEN__)
+/**
+ * @brief Returns a pointer to the idle thread.
+ * @pre In order to use this function the option @p CH_CFG_NO_IDLE_THREAD
+ * must be disabled.
+ * @note The reference counter of the idle thread is not incremented but
+ * it is not strictly required being the idle thread a static
+ * object.
+ *
+ * @return Pointer to the idle thread.
+ *
+ * @xclass
+ */
+static inline thread_t *chThdGetIdleX(void) {
+
+ return ch.rlist.r_queue.p_prev;
+}
+#endif /* !CH_CFG_NO_IDLE_THREAD */
+
/**
* @brief Returns the current thread priority.
* @note Can be invoked in any context.