diff options
| author | Chen Wang <[email protected]> | 2025-09-02 15:37:30 +0800 |
|---|---|---|
| committer | R b b666 <[email protected]> | 2025-09-02 18:05:44 +0800 |
| commit | f44ce3a64cbd18d12ab5873ebfb2587adc0f3c31 (patch) | |
| tree | 77266df81ee2903d68c2bd08ec7d56c5eb6d2e3b /include | |
| parent | 98a12f1c24caf2bbef6ddba0173d01a4419296ae (diff) | |
doxygen: updated doc for thread management subsystem
Signed-off-by: Chen Wang <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/rtdef.h | 3 | ||||
| -rw-r--r-- | include/rtthread.h | 23 |
2 files changed, 24 insertions, 2 deletions
diff --git a/include/rtdef.h b/include/rtdef.h index 1d6993eab6..2cfec3da0a 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -848,9 +848,8 @@ struct rt_user_context typedef void (*rt_thread_cleanup_t)(struct rt_thread *tid); /** - * Thread structure + * @brief Thread Control Block */ - struct rt_thread { struct rt_object parent; 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); |
