summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/thread.c24
-rw-r--r--src/timer.c8
2 files changed, 15 insertions, 17 deletions
diff --git a/src/thread.c b/src/thread.c
index 7bd4ea6e33..f0f1422a02 100755
--- a/src/thread.c
+++ b/src/thread.c
@@ -85,8 +85,7 @@ void rt_thread_inited_sethook(void (*hook)(rt_thread_t thread))
{
rt_thread_inited_hook = hook;
}
-
-#endif /* RT_USING_HOOK */
+#endif /* defined(RT_USING_HOOK) && defined(RT_HOOK_USING_FUNC_PTR) */
static void _thread_exit(void)
{
@@ -195,7 +194,7 @@ static rt_err_t _thread_init(struct rt_thread *thread,
#ifdef RT_USING_EVENT
thread->event_set = 0;
thread->event_info = 0;
-#endif
+#endif /* RT_USING_EVENT */
#if RT_THREAD_PRIORITY_MAX > 32
thread->number = 0;
@@ -251,12 +250,11 @@ static rt_err_t _thread_init(struct rt_thread *thread,
#ifdef RT_USING_CPU_USAGE
thread->duration_tick = 0;
-#endif
-
+#endif /* RT_USING_CPU_USAGE */
#ifdef RT_USING_MODULE
thread->module_id = 0;
-#endif
+#endif /* RT_USING_MODULE */
RT_OBJECT_HOOK_CALL(rt_thread_inited_hook, (thread));
@@ -473,13 +471,13 @@ rt_thread_t rt_thread_create(const char *name,
}
_thread_init(thread,
- name,
- entry,
- parameter,
- stack_start,
- stack_size,
- priority,
- tick);
+ name,
+ entry,
+ parameter,
+ stack_start,
+ stack_size,
+ priority,
+ tick);
return thread;
}
diff --git a/src/timer.c b/src/timer.c
index 0600f85694..0034a53c71 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -118,10 +118,10 @@ void rt_timer_exit_sethook(void (*hook)(struct rt_timer *timer))
* @param flag the flag of timer
*/
static void _timer_init(rt_timer_t timer,
- void (*timeout)(void *parameter),
- void *parameter,
- rt_tick_t time,
- rt_uint8_t flag)
+ void (*timeout)(void *parameter),
+ void *parameter,
+ rt_tick_t time,
+ rt_uint8_t flag)
{
int i;