From 8061067343e2eda986616bb68aa52fe7fded5456 Mon Sep 17 00:00:00 2001 From: "bernard.xiong@gmail.com" Date: Sat, 14 Apr 2012 03:51:34 +0000 Subject: [PATCH] cleanup code comments and deprecate rt_system_timer_init function. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2045 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- src/scheduler.c | 10 +++++----- src/timer.c | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/scheduler.c b/src/scheduler.c index a55cea2283..3a08b72942 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -38,11 +38,11 @@ struct rt_thread *rt_current_thread; rt_uint8_t rt_current_priority; #if RT_THREAD_PRIORITY_MAX > 32 -/* maximun priority level, 256 */ +/* Maximum priority level, 256 */ rt_uint32_t rt_thread_ready_priority_group; rt_uint8_t rt_thread_ready_table[32]; #else -/* maximun priority level, 32 */ +/* Maximum priority level, 32 */ rt_uint32_t rt_thread_ready_priority_group; #endif @@ -140,15 +140,15 @@ void rt_system_scheduler_init(void) rt_current_priority = RT_THREAD_PRIORITY_MAX - 1; rt_current_thread = RT_NULL; - /* init ready priority group */ + /* initialize ready priority group */ rt_thread_ready_priority_group = 0; #if RT_THREAD_PRIORITY_MAX > 32 - /* init ready table */ + /* initialize ready table */ rt_memset(rt_thread_ready_table, 0, sizeof(rt_thread_ready_table)); #endif - /* init thread defunct */ + /* initialize thread defunct */ rt_list_init(&rt_thread_defunct); } diff --git a/src/timer.c b/src/timer.c index 03babc49fe..ce3df9bc1a 100644 --- a/src/timer.c +++ b/src/timer.c @@ -23,7 +23,7 @@ #include /* hard timer list */ -static rt_list_t rt_timer_list; +static rt_list_t rt_timer_list = RT_LIST_OBJECT_INIT(rt_timer_list); #ifdef RT_USING_TIMER_SOFT /* soft timer list */ @@ -500,15 +500,12 @@ static void rt_thread_timer_entry(void *parameter) * @ingroup SystemInit * * This function will initialize system timer + * + * @deprecated since 1.1.0, this function does not need to be invoked + * in the system initialization. */ void rt_system_timer_init(void) { - rt_list_init(&rt_timer_list); - -#ifdef RT_USING_TIMER_SOFT - rt_list_init(&rt_soft_timer_list); - rt_sem_init(&timer_sem, "timer", 0, RT_IPC_FLAG_FIFO); -#endif } /** @@ -519,6 +516,9 @@ void rt_system_timer_init(void) void rt_system_timer_thread_init(void) { #ifdef RT_USING_TIMER_SOFT + rt_list_init(&rt_soft_timer_list); + rt_sem_init(&timer_sem, "timer", 0, RT_IPC_FLAG_FIFO); + /* start software timer thread */ rt_thread_init(&timer_thread, "timer", -- GitLab