[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paparazzi-commits] [5676] moved some arch independant macros up
From: |
antoine drouin |
Subject: |
[paparazzi-commits] [5676] moved some arch independant macros up |
Date: |
Wed, 25 Aug 2010 14:25:16 +0000 |
Revision: 5676
http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=5676
Author: poine
Date: 2010-08-25 14:25:15 +0000 (Wed, 25 Aug 2010)
Log Message:
-----------
moved some arch independant macros up
Modified Paths:
--------------
paparazzi3/trunk/sw/airborne/arm7/sys_time_hw.h
paparazzi3/trunk/sw/airborne/stm32/sys_time_hw.h
paparazzi3/trunk/sw/airborne/sys_time.h
Modified: paparazzi3/trunk/sw/airborne/arm7/sys_time_hw.h
===================================================================
--- paparazzi3/trunk/sw/airborne/arm7/sys_time_hw.h 2010-08-25 13:17:13 UTC
(rev 5675)
+++ paparazzi3/trunk/sw/airborne/arm7/sys_time_hw.h 2010-08-25 14:25:15 UTC
(rev 5676)
@@ -29,7 +29,7 @@
#ifndef SYS_TIME_HW_H
#define SYS_TIME_HW_H
-
+#include "sys_time.h"
#include "std.h"
#include "LPC21xx.h"
#include BOARD_CONFIG
@@ -118,25 +118,20 @@
}
-#define SYS_TICS_OF_SEC(s) (uint32_t)(s * PCLK / T0_PCLK_DIV + 0.5)
-#define SYS_TICS_OF_USEC(us) SYS_TICS_OF_SEC((us) * 1e-6)
-#define SYS_TICS_OF_NSEC(ns) SYS_TICS_OF_SEC((ns) * 1e-9)
+#define SYS_TICS_OF_SEC(s) (uint32_t)(s * PCLK / T0_PCLK_DIV + 0.5)
#define SIGNED_SYS_TICS_OF_SEC(s) (int32_t)(s * PCLK / T0_PCLK_DIV + 0.5)
-#define SIGNED_SYS_TICS_OF_USEC(us) SIGNED_SYS_TICS_OF_SEC((us) * 1e-6)
-#define SEC_OF_SYS_TICS(st) (st / PCLK * T0_PCLK_DIV)
+
+#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))
-#define FIFTY_MS SYS_TICS_OF_SEC( 50e-3 )
-#define AVR_PERIOD_MS SYS_TICS_OF_SEC( 16.666e-3 )
#ifndef PERIODIC_TASK_PERIOD
#define PERIODIC_TASK_PERIOD AVR_PERIOD_MS
#endif
-#define TIME_TICKS_PER_SEC SYS_TICS_OF_SEC(1)
#define InitSysTimePeriodic() last_periodic_event = T0TC;
Modified: paparazzi3/trunk/sw/airborne/stm32/sys_time_hw.h
===================================================================
--- paparazzi3/trunk/sw/airborne/stm32/sys_time_hw.h 2010-08-25 13:17:13 UTC
(rev 5675)
+++ paparazzi3/trunk/sw/airborne/stm32/sys_time_hw.h 2010-08-25 14:25:15 UTC
(rev 5676)
@@ -30,6 +30,8 @@
#ifndef SYS_TIME_HW_H
#define SYS_TIME_HW_H
+#include "sys_time.h"
+
#include <stm32/gpio.h>
#include <stm32/rcc.h>
#include "std.h"
@@ -45,8 +47,8 @@
extern volatile bool_t sys_time_period_elapsed;
extern uint32_t cpu_time_ticks;
-#define SYS_TICS_OF_SEC(s) (uint32_t)((s) * AHB_CLK + 0.5)
-#define TIME_TICKS_PER_SEC SYS_TICS_OF_SEC(1.)
+#define SYS_TICS_OF_SEC(s) (uint32_t)((s) * AHB_CLK + 0.5)
+#define SIGNED_SYS_TICS_OF_SEC(s) (int32_t)((s) * AHB_CLK + 0.5)
static inline bool_t sys_time_periodic( void ) {
if (sys_time_period_elapsed) {
Modified: paparazzi3/trunk/sw/airborne/sys_time.h
===================================================================
--- paparazzi3/trunk/sw/airborne/sys_time.h 2010-08-25 13:17:13 UTC (rev
5675)
+++ paparazzi3/trunk/sw/airborne/sys_time.h 2010-08-25 14:25:15 UTC (rev
5676)
@@ -35,8 +35,19 @@
extern uint16_t cpu_time_sec;
+#define SYS_TICS_OF_USEC(us) SYS_TICS_OF_SEC((us) * 1e-6)
+#define SYS_TICS_OF_NSEC(ns) SYS_TICS_OF_SEC((ns) * 1e-9)
+#define SIGNED_SYS_TICS_OF_USEC(us) SIGNED_SYS_TICS_OF_SEC((us) * 1e-6)
+#define SIGNED_SYS_TICS_OF_NSEC(us) SIGNED_SYS_TICS_OF_SEC((us) * 1e-9)
+
+#define TIME_TICKS_PER_SEC SYS_TICS_OF_SEC( 1.)
+#define FIFTY_MS SYS_TICS_OF_SEC( 50e-3 )
+#define AVR_PERIOD_MS SYS_TICS_OF_SEC( 16.666e-3 )
+
#ifndef READYBOARD_SYS_TIME
#include "sys_time_hw.h"
#endif
+
+
#endif /* SYS_TIME_H */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paparazzi-commits] [5676] moved some arch independant macros up,
antoine drouin <=