Skip to content

Commit 3dd4f71

Browse files
unicornxRbb666
authored andcommitted
doxygen: cleanup code for group_thread_management
The cleanup involved three parts: - Merging the standalone "/**@{*/" into "@addtogroup group_thread_management" - Changing "/**@}*/" to "/** @} group_thread_management */", adding the group name makes it easier to find the matching "@{" part. - Deleting the "@addtogroup" directive in "include/rtthread.h" because this header file doesn't have doxygen comments. All doxygen comments for function bodies are defined in other .c files. Note, we remian two doxygen comments for rt_thread_inited_hookproto_t and rt_thread_idle_sethook in the "include/rtthread.h". rt_thread_inited_hookproto_t is really defined here. For rt_thread_idle_sethook, please see FIXME comment for reason. Signed-off-by: Chen Wang <[email protected]>
1 parent 05dc189 commit 3dd4f71

File tree

7 files changed

+29
-26
lines changed

7 files changed

+29
-26
lines changed

include/rtdef.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,10 +591,9 @@ typedef void (*rt_sighandler_t)(int signo);
591591

592592
/**
593593
* @addtogroup group_thread_management
594+
* @{
594595
*/
595596

596-
/**@{*/
597-
598597
/*
599598
* Thread
600599
*/
@@ -955,7 +954,7 @@ typedef struct rt_thread *rt_thread_t;
955954
#define LWP_IS_USER_MODE(t) (0)
956955
#endif /* RT_USING_SMART */
957956

958-
/**@}*/
957+
/** @} group_thread_management */
959958

960959
/**
961960
* @addtogroup group_thread_comm

include/rtthread.h

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,6 @@ void rt_timer_exit_sethook(void (*hook)(struct rt_timer *timer));
131131

132132
/**@}*/
133133

134-
/**
135-
* @addtogroup group_thread_management
136-
* @{
137-
*/
138-
139134
/*
140135
* thread interface
141136
*/
@@ -187,6 +182,8 @@ void rt_thread_suspend_sethook(void (*hook)(rt_thread_t thread));
187182
void rt_thread_resume_sethook (void (*hook)(rt_thread_t thread));
188183

189184
/**
185+
* @ingroup group_thread_management
186+
*
190187
* @brief Sets a hook function when a thread is initialized.
191188
*
192189
* @param thread is the target thread that initializing
@@ -201,11 +198,12 @@ RT_OBJECT_HOOKLIST_DECLARE(rt_thread_inited_hookproto_t, rt_thread_inited);
201198
*/
202199
void rt_thread_idle_init(void);
203200
#if defined(RT_USING_HOOK) || defined(RT_USING_IDLE_HOOK)
204-
// FIXME: Have to write doxygen comment here for rt_thread_idle_sethook/rt_thread_idle_delhook
201+
// FIXME: Have to write doxygen comment here for rt_thread_idle_sethook
205202
// but not in src/idle.c. Because the `rt_align(RT_ALIGN_SIZE)` in src/idle.c
206-
// will make wierd output for html document generation, i.e. can not generate
207-
// function link to rt_thread_idle_sethook, while function link to rt_thread_idle_delhook is ok.
203+
// will make doxygen building failed.
208204
/**
205+
* @ingroup group_thread_management
206+
*
209207
* @brief This function sets a hook function to idle thread loop. When the system performs
210208
* idle loop, this hook function should be invoked.
211209
*
@@ -217,14 +215,6 @@ void rt_thread_idle_init(void);
217215
* @note the hook function must be simple and never be blocked or suspend.
218216
*/
219217
rt_err_t rt_thread_idle_sethook(void (*hook)(void));
220-
/**
221-
* @brief delete the idle hook on hook list.
222-
*
223-
* @param hook the specified hook function.
224-
*
225-
* @return `RT_EOK`: delete OK.
226-
* `-RT_ENOSYS`: hook was not found.
227-
*/
228218
rt_err_t rt_thread_idle_delhook(void (*hook)(void));
229219
#endif /* defined(RT_USING_HOOK) || defined(RT_USING_IDLE_HOOK) */
230220
rt_thread_t rt_thread_idle_gethandler(void);
@@ -265,8 +255,6 @@ void rt_secondary_cpu_entry(void);
265255
void rt_scheduler_ipi_handler(int vector, void *param);
266256
#endif /* RT_USING_SMP */
267257

268-
/**@}*/
269-
270258
/**
271259
* @addtogroup group_signal
272260
* @{

src/idle.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,19 @@ rt_err_t rt_thread_idle_sethook(void (*hook)(void))
7979
return ret;
8080
}
8181

82+
/**
83+
* @addtogroup group_thread_management
84+
* @{
85+
*/
86+
87+
/**
88+
* @brief delete the idle hook on hook list.
89+
*
90+
* @param hook the specified hook function.
91+
*
92+
* @return `RT_EOK`: delete OK.
93+
* `-RT_ENOSYS`: hook was not found.
94+
*/
8295
rt_err_t rt_thread_idle_delhook(void (*hook)(void))
8396
{
8497
rt_size_t i;
@@ -198,3 +211,5 @@ rt_thread_t rt_thread_idle_gethandler(void)
198211

199212
return (rt_thread_t)(&idle_thread[id]);
200213
}
214+
215+
/** @} group_thread_management */

src/scheduler_mp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,7 @@ rt_err_t rt_sched_thread_bind_cpu(struct rt_thread *thread, int cpu)
15821582
}
15831583

15841584
/**
1585-
* @}
1585+
* @} group_thread_management
15861586
*
15871587
* @endcond
15881588
*/

src/scheduler_up.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ rt_err_t rt_sched_thread_bind_cpu(struct rt_thread *thread, int cpu)
724724
}
725725

726726
/**
727-
* @}
727+
* @} group_thread_management
728728
*
729729
* @endcond
730730
*/

src/signal.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,8 @@ void rt_thread_free_sig(rt_thread_t tid)
579579
}
580580

581581
/**
582+
* @ingroup group_thread_management
583+
*
582584
* @brief This function can be used to send any signal to any thread.
583585
*
584586
* @param tid is a pointer to the thread that receives the signal.

src/thread.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,9 @@ static rt_err_t _thread_init(struct rt_thread *thread,
294294

295295
/**
296296
* @addtogroup group_thread_management
297+
* @{
297298
*/
298299

299-
/**@{*/
300-
301300
/**
302301
* @brief This function will initialize a thread. It's used to initialize a
303302
* static thread object.
@@ -1209,4 +1208,4 @@ rt_err_t rt_thread_get_name(rt_thread_t thread, char *name, rt_uint8_t name_size
12091208
}
12101209
RTM_EXPORT(rt_thread_get_name);
12111210

1212-
/**@}*/
1211+
/** @} group_thread_management */

0 commit comments

Comments
 (0)