diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-10-03 12:21:20 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-10-03 12:21:20 +0000 |
commit | 459c337817e461bc5aed4d14fab869e7d699b6f1 (patch) | |
tree | 4c0d7f6d3cc19316ac79767b000f7005c442d015 /nuttx/include/time.h | |
parent | 5246751cb564522530b70b4f171dbd3d09a6eb4b (diff) | |
download | px4-nuttx-459c337817e461bc5aed4d14fab869e7d699b6f1.tar.gz px4-nuttx-459c337817e461bc5aed4d14fab869e7d699b6f1.tar.bz2 px4-nuttx-459c337817e461bc5aed4d14fab869e7d699b6f1.zip |
Restore CLOCK_ACTIVETIME
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4009 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include/time.h')
-rw-r--r-- | nuttx/include/time.h | 21 |
1 files changed, 19 insertions, 2 deletions
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 |