summaryrefslogtreecommitdiff
path: root/nuttx/sched
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-20 14:12:52 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-20 14:12:52 +0000
commit2c6eb1d98e93b702ab5fe8dbfd69b9ed95d79843 (patch)
tree082db98ee6eb57d6da6ba9c3bf8ad630efbfbe4f /nuttx/sched
parentfb0960f36c48d3dc2e21d3f5193788f23b6bfa48 (diff)
downloadpx4-nuttx-2c6eb1d98e93b702ab5fe8dbfd69b9ed95d79843.tar.gz
px4-nuttx-2c6eb1d98e93b702ab5fe8dbfd69b9ed95d79843.tar.bz2
px4-nuttx-2c6eb1d98e93b702ab5fe8dbfd69b9ed95d79843.zip
Rename uptime to UTC
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3528 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched')
-rw-r--r--nuttx/sched/Makefile4
-rw-r--r--nuttx/sched/clock_getutc.c (renamed from nuttx/sched/clock_uptime.c)12
-rw-r--r--nuttx/sched/clock_initialize.c28
3 files changed, 22 insertions, 22 deletions
diff --git a/nuttx/sched/Makefile b/nuttx/sched/Makefile
index bc2852c54..2ad17f826 100644
--- a/nuttx/sched/Makefile
+++ b/nuttx/sched/Makefile
@@ -80,8 +80,8 @@ CLOCK_SRCS = clock_initialize.c clock_settime.c clock_gettime.c clock_getres.c \
clock_time2ticks.c clock_abstime2ticks.c clock_ticks2time.c \
clock_gettimeofday.c clock_systimer.c
-ifeq ($(CONFIG_UPTIME),y)
-CLOCK_SRCS += clock_uptime.c
+ifeq ($(CONFIG_SYSTEM_UTC),y)
+CLOCK_SRCS += clock_getutc.c
endif
SIGNAL_SRCS = sig_initialize.c \
diff --git a/nuttx/sched/clock_uptime.c b/nuttx/sched/clock_getutc.c
index 203d056fd..95c097019 100644
--- a/nuttx/sched/clock_uptime.c
+++ b/nuttx/sched/clock_getutc.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/clock_uptime.c
+ * sched/clock_getutc.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -44,7 +44,7 @@
#include <nuttx/time.h>
#include <nuttx/rtc.h>
-#if !defined(CONFIG_DISABLE_CLOCK) && defined(CONFIG_UPTIME) && !defined(clock_uptime)
+#if !defined(CONFIG_DISABLE_CLOCK) && defined(CONFIG_SYSTEM_UTC) && !defined(clock_getutc)
/****************************************************************************
* Pre-processor Definitions
@@ -59,7 +59,7 @@
****************************************************************************/
/****************************************************************************
- * Function: clock_uptime
+ * Function: clock_getutc
*
* Description:
* Return the current value of the system timer counter, which is only
@@ -75,7 +75,7 @@
*
****************************************************************************/
-time_t clock_uptime(void)
+time_t clock_getutc(void)
{
#ifdef CONFIG_RTC
if (g_rtc_enabled)
@@ -85,8 +85,8 @@ time_t clock_uptime(void)
else
#endif
{
- return g_uptime;
+ return g_system_utc;
}
}
-#endif /* CONFIG_DISABLE_CLOCK && CONFIG_UPTIME */
+#endif /* CONFIG_DISABLE_CLOCK && CONFIG_SYSTEM_UTC */
diff --git a/nuttx/sched/clock_initialize.c b/nuttx/sched/clock_initialize.c
index 2bb4d87a8..91220c19e 100644
--- a/nuttx/sched/clock_initialize.c
+++ b/nuttx/sched/clock_initialize.c
@@ -60,7 +60,7 @@
#define SEC_PER_HOUR ((time_t)60 * SEC_PER_MIN)
#define SEC_PER_DAY ((time_t)24 * SEC_PER_HOUR)
-/* Defined just so the uptime counter and system timer look similar */
+/* Defined just so the UTC counter and system counter/timer look similar */
#define incr_systimer() g_system_timer++
@@ -82,8 +82,8 @@
volatile clock_t g_system_timer = 0;
-#if CONFIG_UPTIME
-volatile time_t g_uptime = 0;
+#if CONFIG_SYSTEM_UTC
+volatile time_t g_system_utc = 0;
#endif
struct timespec g_basetime = {0,0};
@@ -94,10 +94,10 @@ uint32_t g_tickbias = 0;
**************************************************************************/
/* This variable is used to count ticks and to increment the one-second
- * uptime variable.
+ * UTC variable.
*/
-#if CONFIG_UPTIME
+#if CONFIG_SYSTEM_UTC
#if TICK_PER_SEC > 32767
static uint32_t g_tickcount = 0;
#elif TICK_PER_SEC > 255
@@ -105,7 +105,7 @@ static uint16_t g_tickcount = 0;
#else
static uint8_t g_tickcount = 0;
#endif
-#endif /* CONFIG_UPTIME */
+#endif /* CONFIG_SYSTEM_UTC */
/**************************************************************************
* Private Functions
@@ -120,19 +120,19 @@ static uint8_t g_tickcount = 0;
*
****************************************************************************/
-#if CONFIG_UPTIME
-static inline void incr_uptime(void)
+#if CONFIG_SYSTEM_UTC
+static inline void incr_utc(void)
{
g_tickcount++;
if (g_tickcount >= TICK_PER_SEC)
{
- g_uptime++;
+ g_system_utc++;
g_tickcount -= TICK_PER_SEC;
}
}
#else
-# define incr_uptime()
+# define incr_utc()
#endif
/****************************************************************************
@@ -160,8 +160,8 @@ void clock_initialize(void)
*/
g_system_timer = 0;
-#ifdef CONFIG_UPTIME
- g_uptime = 0;
+#ifdef CONFIG_SYSTEM_UTC
+ g_system_utc = 0;
#endif
/* Do we have hardware periodic timer support? */
@@ -206,7 +206,7 @@ void clock_timer(void)
incr_systimer();
- /* Increment the per-second uptime counter */
+ /* Increment the per-second UTC counter */
- incr_uptime();
+ incr_utc();
}