add the comment of irq.c

This commit is contained in:
supperthomas 2021-08-15 23:04:22 +08:00
parent fea12e0903
commit 33a6700f16
1 changed files with 25 additions and 14 deletions

View File

@ -9,6 +9,7 @@
* 2006-05-03 Bernard add IRQ_DEBUG * 2006-05-03 Bernard add IRQ_DEBUG
* 2016-08-09 ArdaFu add interrupt enter and leave hook. * 2016-08-09 ArdaFu add interrupt enter and leave hook.
* 2018-11-22 Jesven rt_interrupt_get_nest function add disable irq * 2018-11-22 Jesven rt_interrupt_get_nest function add disable irq
* 2021-08-15 Supperthomas fix the comment
*/ */
#include <rthw.h> #include <rthw.h>
@ -21,19 +22,26 @@ static void (*rt_interrupt_leave_hook)(void);
/** /**
* @ingroup Hook * @ingroup Hook
* This function set a hook function when the system enter a interrupt *
* * @brief This function set a hook function when the system enter a interrupt
*
* @note the hook function must be simple and never be blocked or suspend. * @note the hook function must be simple and never be blocked or suspend.
*
* @param hook The function point to be called
*/ */
void rt_interrupt_enter_sethook(void (*hook)(void)) void rt_interrupt_enter_sethook(void (*hook)(void))
{ {
rt_interrupt_enter_hook = hook; rt_interrupt_enter_hook = hook;
} }
/** /**
* @ingroup Hook * @ingroup Hook
* This function set a hook function when the system exit a interrupt. *
* * @brief This function set a hook function when the system exit a interrupt.
*
* @note the hook function must be simple and never be blocked or suspend. * @note the hook function must be simple and never be blocked or suspend.
*
* @param hook The function point to be called
*/ */
void rt_interrupt_leave_sethook(void (*hook)(void)) void rt_interrupt_leave_sethook(void (*hook)(void))
{ {
@ -53,11 +61,12 @@ void rt_interrupt_leave_sethook(void (*hook)(void))
volatile rt_uint8_t rt_interrupt_nest = 0; volatile rt_uint8_t rt_interrupt_nest = 0;
#endif /* RT_USING_SMP */ #endif /* RT_USING_SMP */
/** /**
* This function will be invoked by BSP, when enter interrupt service routine * @brief This function will be invoked by BSP, when enter interrupt service routine
* *
* @note please don't invoke this routine in application * @note please don't invoke this routine in application
* *
* @see rt_interrupt_leave * @see rt_interrupt_leave
*/ */
void rt_interrupt_enter(void) void rt_interrupt_enter(void)
@ -74,11 +83,12 @@ void rt_interrupt_enter(void)
} }
RTM_EXPORT(rt_interrupt_enter); RTM_EXPORT(rt_interrupt_enter);
/** /**
* This function will be invoked by BSP, when leave interrupt service routine * @brief This function will be invoked by BSP, when leave interrupt service routine
* *
* @note please don't invoke this routine in application * @note please don't invoke this routine in application
* *
* @see rt_interrupt_enter * @see rt_interrupt_enter
*/ */
void rt_interrupt_leave(void) void rt_interrupt_leave(void)
@ -95,13 +105,14 @@ void rt_interrupt_leave(void)
} }
RTM_EXPORT(rt_interrupt_leave); RTM_EXPORT(rt_interrupt_leave);
/** /**
* This function will return the nest of interrupt. * @brief This function will return the nest of interrupt.
* *
* User application can invoke this function to get whether current * User application can invoke this function to get whether current
* context is interrupt context. * context is interrupt context.
* *
* @return the number of nested interrupts. * @return rt_uint8_t the number of nested interrupts.
*/ */
RT_WEAK rt_uint8_t rt_interrupt_get_nest(void) RT_WEAK rt_uint8_t rt_interrupt_get_nest(void)
{ {