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
This commit is contained in:
parent
00548d27a1
commit
8061067343
|
@ -38,11 +38,11 @@ struct rt_thread *rt_current_thread;
|
||||||
rt_uint8_t rt_current_priority;
|
rt_uint8_t rt_current_priority;
|
||||||
|
|
||||||
#if RT_THREAD_PRIORITY_MAX > 32
|
#if RT_THREAD_PRIORITY_MAX > 32
|
||||||
/* maximun priority level, 256 */
|
/* Maximum priority level, 256 */
|
||||||
rt_uint32_t rt_thread_ready_priority_group;
|
rt_uint32_t rt_thread_ready_priority_group;
|
||||||
rt_uint8_t rt_thread_ready_table[32];
|
rt_uint8_t rt_thread_ready_table[32];
|
||||||
#else
|
#else
|
||||||
/* maximun priority level, 32 */
|
/* Maximum priority level, 32 */
|
||||||
rt_uint32_t rt_thread_ready_priority_group;
|
rt_uint32_t rt_thread_ready_priority_group;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -140,15 +140,15 @@ void rt_system_scheduler_init(void)
|
||||||
rt_current_priority = RT_THREAD_PRIORITY_MAX - 1;
|
rt_current_priority = RT_THREAD_PRIORITY_MAX - 1;
|
||||||
rt_current_thread = RT_NULL;
|
rt_current_thread = RT_NULL;
|
||||||
|
|
||||||
/* init ready priority group */
|
/* initialize ready priority group */
|
||||||
rt_thread_ready_priority_group = 0;
|
rt_thread_ready_priority_group = 0;
|
||||||
|
|
||||||
#if RT_THREAD_PRIORITY_MAX > 32
|
#if RT_THREAD_PRIORITY_MAX > 32
|
||||||
/* init ready table */
|
/* initialize ready table */
|
||||||
rt_memset(rt_thread_ready_table, 0, sizeof(rt_thread_ready_table));
|
rt_memset(rt_thread_ready_table, 0, sizeof(rt_thread_ready_table));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* init thread defunct */
|
/* initialize thread defunct */
|
||||||
rt_list_init(&rt_thread_defunct);
|
rt_list_init(&rt_thread_defunct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
14
src/timer.c
14
src/timer.c
|
@ -23,7 +23,7 @@
|
||||||
#include <rthw.h>
|
#include <rthw.h>
|
||||||
|
|
||||||
/* hard timer list */
|
/* 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
|
#ifdef RT_USING_TIMER_SOFT
|
||||||
/* soft timer list */
|
/* soft timer list */
|
||||||
|
@ -500,15 +500,12 @@ static void rt_thread_timer_entry(void *parameter)
|
||||||
* @ingroup SystemInit
|
* @ingroup SystemInit
|
||||||
*
|
*
|
||||||
* This function will initialize system timer
|
* 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)
|
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)
|
void rt_system_timer_thread_init(void)
|
||||||
{
|
{
|
||||||
#ifdef RT_USING_TIMER_SOFT
|
#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 */
|
/* start software timer thread */
|
||||||
rt_thread_init(&timer_thread,
|
rt_thread_init(&timer_thread,
|
||||||
"timer",
|
"timer",
|
||||||
|
|
Loading…
Reference in New Issue