99 * 2006-05-03 Bernard add IRQ_DEBUG
1010 * 2016-08-09 ArdaFu add interrupt enter and leave hook.
1111 * 2018-11-22 Jesven rt_interrupt_get_nest function add disable irq
12+ * 2021-08-15 Supperthomas fix the comment
1213 */
1314
1415#include <rthw.h>
@@ -21,19 +22,26 @@ static void (*rt_interrupt_leave_hook)(void);
2122
2223/**
2324 * @ingroup Hook
24- * This function set a hook function when the system enter a interrupt
25- *
25+ *
26+ * @brief This function set a hook function when the system enter a interrupt
27+ *
2628 * @note the hook function must be simple and never be blocked or suspend.
29+ *
30+ * @param hook The function point to be called
2731 */
2832void rt_interrupt_enter_sethook (void (* hook )(void ))
2933{
3034 rt_interrupt_enter_hook = hook ;
3135}
36+
3237/**
3338 * @ingroup Hook
34- * This function set a hook function when the system exit a interrupt.
35- *
39+ *
40+ * @brief This function set a hook function when the system exit a interrupt.
41+ *
3642 * @note the hook function must be simple and never be blocked or suspend.
43+ *
44+ * @param hook The function point to be called
3745 */
3846void rt_interrupt_leave_sethook (void (* hook )(void ))
3947{
@@ -53,11 +61,12 @@ void rt_interrupt_leave_sethook(void (*hook)(void))
5361volatile rt_uint8_t rt_interrupt_nest = 0 ;
5462#endif /* RT_USING_SMP */
5563
64+
5665/**
57- * This function will be invoked by BSP, when enter interrupt service routine
58- *
66+ * @brief This function will be invoked by BSP, when enter interrupt service routine
67+ *
5968 * @note please don't invoke this routine in application
60- *
69+ *
6170 * @see rt_interrupt_leave
6271 */
6372void rt_interrupt_enter (void )
@@ -74,11 +83,12 @@ void rt_interrupt_enter(void)
7483}
7584RTM_EXPORT (rt_interrupt_enter );
7685
86+
7787/**
78- * This function will be invoked by BSP, when leave interrupt service routine
79- *
88+ * @brief This function will be invoked by BSP, when leave interrupt service routine
89+ *
8090 * @note please don't invoke this routine in application
81- *
91+ *
8292 * @see rt_interrupt_enter
8393 */
8494void rt_interrupt_leave (void )
@@ -95,13 +105,14 @@ void rt_interrupt_leave(void)
95105}
96106RTM_EXPORT (rt_interrupt_leave );
97107
108+
98109/**
99- * This function will return the nest of interrupt.
100- *
110+ * @brief This function will return the nest of interrupt.
111+ *
101112 * User application can invoke this function to get whether current
102113 * context is interrupt context.
103- *
104- * @return the number of nested interrupts.
114+ *
115+ * @return rt_uint8_t the number of nested interrupts.
105116 */
106117RT_WEAK rt_uint8_t rt_interrupt_get_nest (void )
107118{
0 commit comments