diff options
| author | Man, Jianting (Meco) <[email protected]> | 2022-01-10 14:25:46 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-01-10 14:25:46 -0500 |
| commit | c6852aa306d07932bc1a62118029ac332acc3fc9 (patch) | |
| tree | 035cae3629b0a8a63686ffd5212162a334bfeeff /src/timer.c | |
| parent | 1f2e93f1a39590af9a71ecc31b12045696ca6055 (diff) | |
| parent | 982ad7bcbcbdc31305883803fadf63bad72dbc73 (diff) | |
Merge branch 'master' into removeinit
Diffstat (limited to 'src/timer.c')
| -rw-r--r-- | src/timer.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/timer.c b/src/timer.c index 846c33263b..da113298da 100644 --- a/src/timer.c +++ b/src/timer.c @@ -17,6 +17,7 @@ * 2014-07-12 Bernard does not lock scheduler when invoking soft-timer * timeout function. * 2021-08-15 supperthomas add the comment + * 2022-01-07 Gabriel Moving __on_rt_xxxxx_hook to timer.c */ #include <rtthread.h> @@ -47,7 +48,20 @@ ALIGN(RT_ALIGN_SIZE) static rt_uint8_t _timer_thread_stack[RT_TIMER_THREAD_STACK_SIZE]; #endif /* RT_USING_TIMER_SOFT */ -#ifdef RT_USING_HOOK +#ifndef __on_rt_object_take_hook + #define __on_rt_object_take_hook(parent) __ON_HOOK_ARGS(rt_object_take_hook, (parent)) +#endif +#ifndef __on_rt_object_put_hook + #define __on_rt_object_put_hook(parent) __ON_HOOK_ARGS(rt_object_put_hook, (parent)) +#endif +#ifndef __on_rt_timer_enter_hook + #define __on_rt_timer_enter_hook(t) __ON_HOOK_ARGS(rt_timer_enter_hook, (t)) +#endif +#ifndef __on_rt_timer_exit_hook + #define __on_rt_timer_exit_hook(t) __ON_HOOK_ARGS(rt_timer_exit_hook, (t)) +#endif + +#if defined(RT_USING_HOOK) && defined(RT_HOOK_USING_FUNC_PTR) extern void (*rt_object_take_hook)(struct rt_object *object); extern void (*rt_object_put_hook)(struct rt_object *object); static void (*rt_timer_enter_hook)(struct rt_timer *timer); |
