From c1df311d5a496bb3f3a2c955e43b2bdecb5ce590 Mon Sep 17 00:00:00 2001 From: "bernard.xiong@gmail.com" Date: Sat, 8 Dec 2012 15:26:43 +0000 Subject: [PATCH] fix the issue of _timevalue.tv_usec initialization git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2471 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- components/pthreads/clock_time.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/components/pthreads/clock_time.c b/components/pthreads/clock_time.c index 0e587636a..4323addc6 100644 --- a/components/pthreads/clock_time.c +++ b/components/pthreads/clock_time.c @@ -1,3 +1,17 @@ +/* + * File : clock_time.c + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2012, RT-Thread Development Team + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rt-thread.org/license/LICENSE + * + * Change Logs: + * Date Author Notes + * 2012-12-08 Bernard fix the issue of _timevalue.tv_usec initialization, + * which found by Rob + */ #include #include @@ -19,7 +33,7 @@ void clock_time_system_init() /* get tick */ tick = rt_tick_get(); - _timevalue.tv_usec = MICROSECOND_PER_SECOND - (tick%RT_TICK_PER_SECOND) * MICROSECOND_PER_TICK; + _timevalue.tv_usec = (tick%RT_TICK_PER_SECOND) * MICROSECOND_PER_TICK; _timevalue.tv_sec = time - tick/RT_TICK_PER_SECOND - 1; }