summaryrefslogtreecommitdiff
path: root/src/irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/irq.c')
-rw-r--r--src/irq.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/irq.c b/src/irq.c
index 91dc405ad6..72a714fa24 100644
--- a/src/irq.c
+++ b/src/irq.c
@@ -37,8 +37,6 @@ void rt_interrupt_enter()
{
rt_base_t level;
- RT_DEBUG_REENT_IN
-
RT_DEBUG_LOG(RT_DEBUG_IRQ,("irq comming..., irq nest:%d\n", rt_interrupt_nest));
level = rt_hw_interrupt_disable();
@@ -62,8 +60,20 @@ void rt_interrupt_leave()
level = rt_hw_interrupt_disable();
rt_interrupt_nest --;
rt_hw_interrupt_enable(level);
+}
- RT_DEBUG_REENT_OUT
+/**
+ * This function will return the nest of interrupt.
+ *
+ * User application can invoke this function to get whenther current
+ * context is interrupt context.
+ *
+ * @return the number of nested interrupts.
+ */
+rt_uint8_t rt_interrupt_get_nest(void)
+{
+ return rt_interrupt_nest;
}
/*@}*/
+