From 459c337817e461bc5aed4d14fab869e7d699b6f1 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 3 Oct 2011 12:21:20 +0000 Subject: Restore CLOCK_ACTIVETIME git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4009 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/include/time.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'nuttx/include/time.h') diff --git a/nuttx/include/time.h b/nuttx/include/time.h index 69b62f4eb..623f9afb2 100644 --- a/nuttx/include/time.h +++ b/nuttx/include/time.h @@ -67,12 +67,29 @@ # define CLOCKS_PER_SEC (100) #endif -/* This is the only clock_id supported by the "Clock and Timer - * Functions." +/* CLOCK_REALTIME refers to the standard time source. For most implementations, + * the standard time source is the system timer interrupt. However, if the + * platform supports an RTC, then the standard time source will be the RTC + * for the clock_gettime() and clock_settime() interfaces (the system timer + * is still the time source for all of the interfaces). */ #define CLOCK_REALTIME 0 +/* If an RTC is supported, then the non-standard CLOCK_ACTIVETIME is also + * supported to manage time based on the system timer interrupt separately from + * the RTC. This may be necessary, for example, in certain cases where the + * system timer interrupt has been stopped in low power modes. + * + * CLOCK_ACTIVETIME is only recognized by clock_gettime() and clock_settime(). + */ + +#ifdef CONFIG_RTC +# define CLOCK_ACTIVETIME 1 +#else +# define CLOCK_ACTIVETIME CLOCK_REALTIME +#endif + /* This is a flag that may be passed to the timer_settime() function */ #define TIMER_ABSTIME 1 -- cgit v1.2.3