From 214e44c3f9d79e34719cd9cef5e2fc596a693d47 Mon Sep 17 00:00:00 2001 From: "bernard.xiong" Date: Tue, 13 Jul 2010 07:36:37 +0000 Subject: fix down alignment issue; fix the maximal number of rt_scheduler_lock_nest issue; fix rt_tick_from_millisecond issue. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@790 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- src/clock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/clock.c') diff --git a/src/clock.c b/src/clock.c index 6ca918d1f8..f34d09e32f 100644 --- a/src/clock.c +++ b/src/clock.c @@ -14,6 +14,7 @@ * 2006-08-10 Bernard remove the last rt_schedule in rt_tick_increase * 2010-03-08 Bernard remove rt_passed_second * 2010-05-20 Bernard fix the tick exceeds the maximum limits + * 2010-07-13 Bernard fix rt_tick_from_millisecond issue found by kuronca */ #include @@ -95,7 +96,7 @@ void rt_tick_increase() rt_tick_t rt_tick_from_millisecond(rt_uint32_t ms) { /* return the calculated tick */ - return RT_TICK_PER_SECOND * (ms / 1000); + return (RT_TICK_PER_SECOND * ms) / 1000 + (RT_TICK_PER_SECOND * ms) % 1000 ? 1:0; } /*@}*/ -- cgit v1.3.1