summaryrefslogtreecommitdiff
path: root/include/rtthread.h
diff options
context:
space:
mode:
authorChen Wang <[email protected]>2025-09-02 15:37:30 +0800
committerR b b666 <[email protected]>2025-09-02 18:05:44 +0800
commitf44ce3a64cbd18d12ab5873ebfb2587adc0f3c31 (patch)
tree77266df81ee2903d68c2bd08ec7d56c5eb6d2e3b /include/rtthread.h
parent98a12f1c24caf2bbef6ddba0173d01a4419296ae (diff)
doxygen: updated doc for thread management subsystem
Signed-off-by: Chen Wang <[email protected]>
Diffstat (limited to 'include/rtthread.h')
-rw-r--r--include/rtthread.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/rtthread.h b/include/rtthread.h
index f910cfa1c0..73b31cf1e8 100644
--- a/include/rtthread.h
+++ b/include/rtthread.h
@@ -208,7 +208,30 @@ RT_OBJECT_HOOKLIST_DECLARE(rt_thread_inited_hookproto_t, rt_thread_inited);
*/
void rt_thread_idle_init(void);
#if defined(RT_USING_HOOK) || defined(RT_USING_IDLE_HOOK)
+// FIXME: Have to write doxygen comment here for rt_thread_idle_sethook/rt_thread_idle_delhook
+// but not in src/idle.c. Because the `rt_align(RT_ALIGN_SIZE)` in src/idle.c
+// will make wierd output for html document generation, i.e. can not generate
+// function link to rt_thread_idle_sethook, while function link to rt_thread_idle_delhook is ok.
+/**
+ * @brief This function sets a hook function to idle thread loop. When the system performs
+ * idle loop, this hook function should be invoked.
+ *
+ * @param hook the specified hook function.
+ *
+ * @return `RT_EOK`: set OK.
+ * `-RT_EFULL`: hook list is full.
+ *
+ * @note the hook function must be simple and never be blocked or suspend.
+ */
rt_err_t rt_thread_idle_sethook(void (*hook)(void));
+/**
+ * @brief delete the idle hook on hook list.
+ *
+ * @param hook the specified hook function.
+ *
+ * @return `RT_EOK`: delete OK.
+ * `-RT_ENOSYS`: hook was not found.
+ */
rt_err_t rt_thread_idle_delhook(void (*hook)(void));
#endif /* defined(RT_USING_HOOK) || defined(RT_USING_IDLE_HOOK) */
rt_thread_t rt_thread_idle_gethandler(void);