diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-04-12 14:14:47 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-04-12 14:14:47 +0000 |
commit | d5d9e262ee50ae2f423f0587090eb4573c98e6c3 (patch) | |
tree | 55e64594b3b8a3a2235ac3f37c736d44813e725f /nuttx/lib | |
parent | 087feacd1d4ad183b8c9b81a1c664ebfea1278e1 (diff) | |
download | px4-nuttx-d5d9e262ee50ae2f423f0587090eb4573c98e6c3.tar.gz px4-nuttx-d5d9e262ee50ae2f423f0587090eb4573c98e6c3.tar.bz2 px4-nuttx-d5d9e262ee50ae2f423f0587090eb4573c98e6c3.zip |
Add rtc.h header file
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3493 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/lib')
-rw-r--r-- | nuttx/lib/time/lib_gmtime.c | 4 | ||||
-rw-r--r-- | nuttx/lib/time/lib_gmtimer.c | 22 |
2 files changed, 13 insertions, 13 deletions
diff --git a/nuttx/lib/time/lib_gmtime.c b/nuttx/lib/time/lib_gmtime.c index 58dc11c66..7bce8391e 100644 --- a/nuttx/lib/time/lib_gmtime.c +++ b/nuttx/lib/time/lib_gmtime.c @@ -85,9 +85,9 @@ * ****************************************************************************/ -struct tm *gmtime(const time_t *clock) +struct tm *gmtime(const time_t *timer) { static struct tm tm; - return gmtime_r(clock, &tm); + return gmtime_r(timer, &tm); } diff --git a/nuttx/lib/time/lib_gmtimer.c b/nuttx/lib/time/lib_gmtimer.c index f027e678d..b410a74f2 100644 --- a/nuttx/lib/time/lib_gmtimer.c +++ b/nuttx/lib/time/lib_gmtimer.c @@ -296,9 +296,9 @@ static void clock_utc2calendar(time_t days, int *year, int *month, int *day) * ****************************************************************************/ -struct tm *gmtime_r(const time_t *clock, struct tm *result) +struct tm *gmtime_r(const time_t *timer, struct tm *result) { - time_t time; + time_t epoch; time_t jdn; int year; int month; @@ -309,21 +309,21 @@ struct tm *gmtime_r(const time_t *clock, struct tm *result) /* Get the seconds since the EPOCH */ - time = *clock; - sdbg("clock=%d\n", (int)time); + epoch = *timer; + sdbg("timer=%d\n", (int)epoch); /* Convert to days, hours, minutes, and seconds since the EPOCH */ - jdn = time / SEC_PER_DAY; - time -= SEC_PER_DAY * jdn; + jdn = epoch / SEC_PER_DAY; + epoch -= SEC_PER_DAY * jdn; - hour = time / SEC_PER_HOUR; - time -= SEC_PER_HOUR * hour; + hour = epoch / SEC_PER_HOUR; + epoch -= SEC_PER_HOUR * hour; - min = time / SEC_PER_MIN; - time -= SEC_PER_MIN * min; + min = epoch / SEC_PER_MIN; + epoch -= SEC_PER_MIN * min; - sec = time; + sec = epoch; sdbg("hour=%d min=%d sec=%d\n", (int)hour, (int)min, (int)sec); |