From 4edd6a7eeec69080f1e8512cb3a9261a3dd080a7 Mon Sep 17 00:00:00 2001 From: Gautier Hattenberger Date: Thu, 5 Aug 2010 13:14:39 +0000 Subject: [PATCH] add some macros needed by sys_mon module --- sw/airborne/arm7/sys_time_hw.h | 1 + sw/airborne/sim/sys_time_hw.h | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/sw/airborne/arm7/sys_time_hw.h b/sw/airborne/arm7/sys_time_hw.h index 14853079e7..1f7f537f52 100644 --- a/sw/airborne/arm7/sys_time_hw.h +++ b/sw/airborne/arm7/sys_time_hw.h @@ -126,6 +126,7 @@ static inline void sys_time_init( void ) { #define SEC_OF_SYS_TICS(st) (st / PCLK * T0_PCLK_DIV) #define MSEC_OF_SYS_TICS(st) (st / (PCLK/1000) * T0_PCLK_DIV) +#define USEC_OF_SYS_TICS(st) (st / (PCLK/1000000) * T0_PCLK_DIV) #define GET_CUR_TIME_FLOAT() ((float)cpu_time_sec + SEC_OF_SYS_TICS((float)cpu_time_ticks)) diff --git a/sw/airborne/sim/sys_time_hw.h b/sw/airborne/sim/sys_time_hw.h index fda72904f0..6b1119d061 100644 --- a/sw/airborne/sim/sys_time_hw.h +++ b/sw/airborne/sim/sys_time_hw.h @@ -3,9 +3,25 @@ #include +#define SYS_TICS_OF_SEC(x) (x) #define SYS_TICS_OF_USEC(x) (x) +#define SYS_TICS_OF_NSEC(x) (x) +#define SIGNED_SYS_TICS_OF_SEC(x) (x) #define SIGNED_SYS_TICS_OF_USEC(x) (x) +#define SEC_OF_SYS_TICS(st) (st) +#define MSEC_OF_SYS_TICS(st) (st) +#define USEC_OF_SYS_TICS(st) (st) + +#define SysTimeChronoStart() { } +#define SysTimeChronoStop() { } +#define SysTimeChronoStartDisableIRQ() { } +#define SysTimeChronoStopEnableIRQAndSendUS(_tag) { } + +#define SysTimeTimerStart(_t) { } +#define SysTimeTimer(_t) (_t) +#define SysTimeTimerStop(_t) { } + static inline void sys_time_init( void ) {} #define sys_time_periodic() TRUE