From 3af596061470eca0501e4de0057bee6743e56500 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 20 Apr 2011 14:12:52 +0000 Subject: [PATCH] Rename uptime to UTC git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@3528 7fd9a85b-ad96-42d3-883c-3090e2eb8679 --- nuttx/ChangeLog | 2 +- nuttx/Documentation/NuttX.html | 7 +++-- nuttx/include/nuttx/clock.h | 12 ++++---- nuttx/lib/time/lib_time.c | 2 +- nuttx/sched/Makefile | 4 +-- .../sched/{clock_uptime.c => clock_getutc.c} | 12 ++++---- nuttx/sched/clock_initialize.c | 28 +++++++++---------- 7 files changed, 35 insertions(+), 32 deletions(-) rename nuttx/sched/{clock_uptime.c => clock_getutc.c} (92%) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 70496acbe..2a8475d57 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -1693,7 +1693,7 @@ character in the string. * tools/version.sh and mkversion.c: Tools to manage a NuttX version number file - * sched/clock_uptime() and lib/time/lib_time.c: Add support for 1 second uptime + * sched/clock_getutc() and lib/time/lib_time.c: Add support for 1 second UTC interface. * net/net_dup2.c and include/nuttx/net.h: The conditional compilation for '#if CONFIG_NFILE_DESCRIPTOR > 0' was wrong in both of these files. It should diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html index 5c5e2ff88..ce7d9e6bc 100644 --- a/nuttx/Documentation/NuttX.html +++ b/nuttx/Documentation/NuttX.html @@ -8,7 +8,7 @@

NuttX RTOS

-

Last Updated: April 18, 2011

+

Last Updated: April 20, 2011

@@ -2226,7 +2226,7 @@ nuttx-6.2 2011-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> character in the string. * tools/version.sh and mkversion.c: Tools to manage a NuttX version number file - * sched/clock_uptime() and lib/time/lib_time.c: Add support for 1 second uptime + * sched/clock_getutc() and lib/time/lib_time.c: Add support for 1 second UTC interface. * net/net_dup2.c and include/nuttx/net.h: The conditional compilation for '#if CONFIG_NFILE_DESCRIPTOR > 0' was wrong in both of these files. It should @@ -2238,6 +2238,9 @@ nuttx-6.2 2011-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> OLED with Solomon Systech SD1305 LCD controller. * configs/lpcxpresso-lpc1668/nx: Add a NX graphics configuration for the LPCXPRESO board. + * graphics/nxglib/nxglib_nonintersecting.c: Fix some single bit errors in + calculation of non-intersecting regions. This was causing an anomoaly + in examples/nx in column 0. apps-6.1 2011-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> diff --git a/nuttx/include/nuttx/clock.h b/nuttx/include/nuttx/clock.h index 62bc29910..cde1dd2db 100644 --- a/nuttx/include/nuttx/clock.h +++ b/nuttx/include/nuttx/clock.h @@ -127,14 +127,14 @@ #if __HAVE_KERNEL_GLOBALS extern volatile uint32_t g_system_timer; -extern volatile uint32_t g_uptime; +extern volatile uint32_t g_system_utc; #endif #if !defined(CONFIG_RTC) && __HAVE_KERNEL_GLOBALS #define clock_systimer() g_system_timer -#if defined(CONFIG_UPTIME) -#define clock_uptime() g_uptime +#if defined(CONFIG_SYSTEM_UTC) +#define clock_getutc() g_system_utc #endif #endif @@ -174,7 +174,7 @@ EXTERN uint32_t clock_systimer(void); #endif /**************************************************************************** - * Function: clock_uptime + * Function: clock_getutc * * Description: * Return the current value of the system timer counter, which is only @@ -190,8 +190,8 @@ EXTERN uint32_t clock_systimer(void); * ****************************************************************************/ -#if defined(CONFIG_UPTIME) && !__HAVE_KERNEL_GLOBALS -EXTERN time_t clock_uptime(void); +#if defined(CONFIG_SYSTEM_UTC) && !__HAVE_KERNEL_GLOBALS +EXTERN time_t clock_getutc(void); #endif #undef EXTERN diff --git a/nuttx/lib/time/lib_time.c b/nuttx/lib/time/lib_time.c index 6900791a7..0ddd7993f 100644 --- a/nuttx/lib/time/lib_time.c +++ b/nuttx/lib/time/lib_time.c @@ -89,7 +89,7 @@ time_t time(time_t *tloc) struct timeval tp; int ret; - /* Get the current uptime from the system */ + /* Get the current time from the system */ ret = gettimeofday(&tp, NULL); if (ret == OK) 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 similarity index 92% rename from nuttx/sched/clock_uptime.c rename to 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 @@ -44,7 +44,7 @@ #include #include -#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(); }