Rename uptime to UTC
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@3528 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
parent
1ee87d8347
commit
3af5960614
|
@ -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
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<tr align="center" bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
|
||||
<p>Last Updated: April 18, 2011</p>
|
||||
<p>Last Updated: April 20, 2011</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -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>
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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 */
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue