diff options
| author | [email protected] <[email protected]> | 2011-06-14 23:59:42 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2011-06-14 23:59:42 +0000 |
| commit | ee68988518f8aa2b7cdafc2bcfe0abe6ad7df385 (patch) | |
| tree | c673b27eee805e37c3c138e4e1d4c3596f985c9b /src/timer.c | |
| parent | 99dc4465a66d757b1a94220b513d30e647861b4c (diff) | |
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
Diffstat (limited to 'src/timer.c')
| -rw-r--r-- | src/timer.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/src/timer.c b/src/timer.c index 1c7803b85d..b2e1c1e13a 100644 --- a/src/timer.c +++ b/src/timer.c @@ -210,9 +210,7 @@ rt_err_t rt_timer_start(rt_timer_t timer) RT_ASSERT(timer != RT_NULL); if (timer->parent.flag & RT_TIMER_FLAG_ACTIVATED) return -RT_ERROR; -#ifdef RT_USING_HOOK - RT_OBJECT_HOOK_CALL2(rt_object_take_hook,&(timer->parent)); -#endif + RT_OBJECT_HOOK_CALL(rt_object_take_hook, (&(timer->parent))); /* disable interrupt */ level = rt_hw_interrupt_disable(); @@ -277,9 +275,7 @@ rt_err_t rt_timer_stop(rt_timer_t timer) RT_ASSERT(timer != RT_NULL); if(!(timer->parent.flag & RT_TIMER_FLAG_ACTIVATED)) return -RT_ERROR; -#ifdef RT_USING_HOOK - RT_OBJECT_HOOK_CALL2(rt_object_put_hook,&(timer->parent)); -#endif + RT_OBJECT_HOOK_CALL(rt_object_put_hook, (&(timer->parent))); /* disable interrupt */ level = rt_hw_interrupt_disable(); @@ -364,22 +360,14 @@ void rt_timer_check(void) */ if ((current_tick - t->timeout_tick) < RT_TICK_MAX/2) { -#ifdef RT_USING_HOOK - RT_OBJECT_HOOK_CALL2(rt_timer_timeout_hook,t); -#endif + RT_OBJECT_HOOK_CALL(rt_timer_timeout_hook, (t)); /* remove timer from timer list firstly */ rt_list_remove(&(t->list)); - /* Timeout function called while interrupt is disabled, reentant function - is a must */ - RT_DEBUG_REENT_IN - /* call timeout function */ t->timeout_func(t->parameter); - RT_DEBUG_REENT_OUT - /* re-get tick */ current_tick = rt_tick_get(); @@ -455,9 +443,8 @@ void rt_soft_timer_check() */ if ((current_tick - t->timeout_tick) < RT_TICK_MAX/2) { -#ifdef RT_USING_HOOK - RT_OBJECT_HOOK_CALL2(rt_timer_timeout_hook,t); -#endif + RT_OBJECT_HOOK_CALL(rt_timer_timeout_hook, (t)); + /* move node to the next */ n = n->next; |
