diff options
| author | Gabriel Wang <[email protected]> | 2022-01-07 23:35:44 +0000 |
|---|---|---|
| committer | Gabriel Wang <[email protected]> | 2022-01-07 23:35:44 +0000 |
| commit | d7b8cf81e6285f3cbb0817cbe79c527f10ff56b7 (patch) | |
| tree | 3e47ead2e339c0f1181c9ca2f4ffbfec9536d7eb /src/timer.c | |
| parent | 495e209f379338b2bbc4ba086e457d0fb6d22a8d (diff) | |
move some __on_rt_xxxxx_hook from rtdef.h to dedicated c soure files
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); |
