More timer changes from Uros

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3572 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2011-05-06 21:10:00 +00:00
parent 6d9804ac6d
commit 9ecda2e9fa
11 changed files with 245 additions and 175 deletions
+10 -28
View File
@@ -128,15 +128,18 @@
#if __HAVE_KERNEL_GLOBALS
extern volatile uint32_t g_system_timer;
extern volatile uint32_t g_system_utc;
#endif
#if !defined(CONFIG_RTC) && __HAVE_KERNEL_GLOBALS
#if TICK_PER_SEC > 32767
extern volatile uint32_t g_tickcount;
#elif TICK_PER_SEC > 255
extern volatile uint16_t g_tickcount;
#else
extern volatile uint8_t g_tickcount;
#endif
#endif /* __HAVE_KERNEL_GLOBALS */
#if !defined(CONFIG_SYSTEM_UTC) && __HAVE_KERNEL_GLOBALS
#define clock_systimer() g_system_timer
#if defined(CONFIG_SYSTEM_UTC)
#define clock_getutc() g_system_utc
#endif
#endif
/****************************************************************************
@@ -173,27 +176,6 @@ extern "C" {
EXTERN uint32_t clock_systimer(void);
#endif
/****************************************************************************
* Function: clock_getutc
*
* Description:
* Return the current value of the system timer counter, which is only
* enabled when system is in active mode.
*
* Parameters:
* None
*
* Return Value:
* The current value of the system time counter
*
* Assumptions:
*
****************************************************************************/
#if defined(CONFIG_SYSTEM_UTC) && !__HAVE_KERNEL_GLOBALS
EXTERN time_t clock_getutc(void);
#endif
#undef EXTERN
#ifdef __cplusplus
}
+17 -8
View File
@@ -60,28 +60,37 @@
*/
#ifdef CONFIG_MSEC_PER_TICK
# define CLK_TCK (1000/CONFIG_MSEC_PER_TICK)
# define CLOCKS_PER_SEC (1000/CONFIG_MSEC_PER_TICK)
# define CLK_TCK (1000/CONFIG_MSEC_PER_TICK)
# define CLOCKS_PER_SEC (1000/CONFIG_MSEC_PER_TICK)
#else
# define CLK_TCK (100)
# define CLOCKS_PER_SEC (100)
# define CLK_TCK (100)
# define CLOCKS_PER_SEC (100)
#endif
/* This is the only clock_id supported by the "Clock and Timer
* Functions."
*/
#define CLOCK_REALTIME 0
#define CLOCK_REALTIME 0
/* Non-standard. Returns active UTC time, which is disabled during
* power down modes. Unit is 1 second.
*/
#ifdef CONFIG_RTC
# define CLOCK_ACTIVETIME 1
#endif
#define CLOCK_ABSTIME
/* This is a flag that may be passed to the timer_settime() function */
#define TIMER_ABSTIME 1
#define TIMER_ABSTIME 1
/* Local time is the same as gmtime in this implementation */
#define localtime(c) gmtime(c)
#define localtime_r(c,r) gmtime_r(c,r)
#define localtime(c) gmtime(c)
#define localtime_r(c,r) gmtime_r(c,r)
/********************************************************************************
* Global Type Declarations