summaryrefslogtreecommitdiff
path: root/src/clock.c
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2010-07-13 07:36:37 +0000
committerbernard.xiong <[email protected]>2010-07-13 07:36:37 +0000
commit214e44c3f9d79e34719cd9cef5e2fc596a693d47 (patch)
tree5270f946a824b0d54689953aca65d6039ffaee3b /src/clock.c
parent69466590ff78faa11ed508d74a5509113b8dace0 (diff)
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
Diffstat (limited to 'src/clock.c')
-rw-r--r--src/clock.c3
1 files changed, 2 insertions, 1 deletions
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 <rtthread.h>
@@ -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;
}
/*@}*/