diff options
| author | [email protected] <[email protected]> | 2012-12-08 15:26:43 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2012-12-08 15:26:43 +0000 |
| commit | c1df311d5a496bb3f3a2c955e43b2bdecb5ce590 (patch) | |
| tree | 220cd673743a6cac7dc71143566390a4d9d8998c /components | |
| parent | 6d78189f1b1baa7fc7db56947a726182040b5738 (diff) | |
fix the issue of _timevalue.tv_usec initialization
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2471 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components')
| -rw-r--r-- | components/pthreads/clock_time.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/components/pthreads/clock_time.c b/components/pthreads/clock_time.c index 0e587636aa..4323addc67 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 <[email protected]>
+ */
#include <rtthread.h>
#include <pthread.h>
@@ -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;
}
|
