From ee68988518f8aa2b7cdafc2bcfe0abe6ad7df385 Mon Sep 17 00:00:00 2001 From: "bernard.xiong@gmail.com" Date: Tue, 14 Jun 2011 23:59:42 +0000 Subject: change the RT_DEBUG_NOT_REENT to RT_DEBUG_NOT_IN_INTERRUPT. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1503 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- src/irq.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/irq.c') 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; } /*@}*/ + -- cgit v1.3.1