提交 a810c1ae 编写于 作者: D dzzxzz@gmail.com

convert the tabs to spaces in clock.c

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2501 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 0e40d55d
......@@ -49,8 +49,8 @@ void rt_system_tick_init(void)
*/
rt_tick_t rt_tick_get(void)
{
/* return the global tick */
return rt_tick;
/* return the global tick */
return rt_tick;
}
RTM_EXPORT(rt_tick_get);
......@@ -59,11 +59,11 @@ RTM_EXPORT(rt_tick_get);
*/
void rt_tick_set(rt_tick_t tick)
{
rt_base_t level;
rt_base_t level;
level = rt_hw_interrupt_disable();
rt_tick = tick;
rt_hw_interrupt_enable(level);
level = rt_hw_interrupt_disable();
rt_tick = tick;
rt_hw_interrupt_enable(level);
}
/**
......@@ -72,26 +72,26 @@ void rt_tick_set(rt_tick_t tick)
*/
void rt_tick_increase(void)
{
struct rt_thread *thread;
struct rt_thread *thread;
/* increase the global tick */
++ rt_tick;
/* increase the global tick */
++ rt_tick;
/* check time slice */
thread = rt_thread_self();
/* check time slice */
thread = rt_thread_self();
-- thread->remaining_tick;
if (thread->remaining_tick == 0)
{
/* change to initialized tick */
thread->remaining_tick = thread->init_tick;
-- thread->remaining_tick;
if (thread->remaining_tick == 0)
{
/* change to initialized tick */
thread->remaining_tick = thread->init_tick;
/* yield */
rt_thread_yield();
}
/* yield */
rt_thread_yield();
}
/* check timer */
rt_timer_check();
/* check timer */
rt_timer_check();
}
/**
......@@ -103,8 +103,8 @@ void rt_tick_increase(void)
*/
rt_tick_t rt_tick_from_millisecond(rt_uint32_t ms)
{
/* return the calculated tick */
return (RT_TICK_PER_SECOND * ms + 999) / 1000;
/* return the calculated tick */
return (RT_TICK_PER_SECOND * ms + 999) / 1000;
}
RTM_EXPORT(rt_tick_from_millisecond);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册