summaryrefslogtreecommitdiff
path: root/src/idle.c
diff options
context:
space:
mode:
authorArdaFu <[email protected]>2016-08-09 11:29:11 +0800
committerArdaFu <[email protected]>2016-08-09 11:29:11 +0800
commit189e9b9632abca70c3a78403a9ad737dfd471da8 (patch)
treeba0b9c77564ff7a7f4adb3712a925461fe1a7048 /src/idle.c
parenta0d264ba7245fb9ddbd2bf45652286655499066c (diff)
[Kernel] add new hooks for support trace componment.
Diffstat (limited to 'src/idle.c')
-rw-r--r--src/idle.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/idle.c b/src/idle.c
index 867af87612..aab09cb913 100644
--- a/src/idle.c
+++ b/src/idle.c
@@ -24,6 +24,7 @@
* 2012-12-29 Bernard fix compiling warning.
* 2013-12-21 Grissiom let rt_thread_idle_excute loop until there is no
* dead thread.
+ * 2016-08-09 ArdaFu add method to get the handler of the idle thread.
*/
#include <rthw.h>
@@ -178,11 +179,7 @@ static void rt_thread_idle_entry(void *parameter)
{
while (1)
{
- #ifdef RT_USING_HOOK
- if (rt_thread_idle_hook != RT_NULL)
- rt_thread_idle_hook();
- #endif
-
+ RT_OBJECT_HOOK_CALL(rt_thread_idle_hook,());
rt_thread_idle_excute();
}
}
@@ -209,3 +206,14 @@ void rt_thread_idle_init(void)
/* startup */
rt_thread_startup(&idle);
}
+
+/**
+ * @ingroup Thread
+ *
+ * This function will get the handler of the idle thread.
+ *
+ */
+rt_thread_t rt_thread_idle_gethandler(void)
+{
+ return (rt_thread_t)(&idle);
+}